Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serializeAllProperties returns lines in a different structure than getLine from ifcApi #168

Closed
quasarchimaere opened this issue Dec 7, 2022 · 20 comments · Fixed by #179
Closed

Comments

@quasarchimaere
Copy link

Retrieving all the lines as a properties blob is great, however the lines that are retrieved do not have the same structure as the ones that you get from the getLine function. Digging into IFCWorker.js:88765 the cause is very clear:

getItemProperty(modelID, id, properties) {
        try {
            const props = await this.webIfc.GetLine(modelID, id);
            if (props.type) {
                props.type = IfcTypesMap[props.type]; // ******** Q: Why is the type replaced from the number to the string?
            }
            this.formatItemProperties(props);
            properties[id] = props;
        }
        catch (e) {
            console.log(`There was a problem getting the properties of the item with ID ${id}`);
        }
    }
    formatItemProperties(props) {
        Object.keys(props).forEach((key) => {
            const value = props[key];
            if (value && value.value !== undefined)
                props[key] = value.value; // ************** Q: Why do you set it directly to the value and drop the object structure underneath
            else if (Array.isArray(value))
                props[key] = value.map((item) => {
                    if (item && item.value)
                        return item.value; // ************** Q: Same Question as above
                    return item;
                });
        });
    }

2 Questions:

  • Why does the structure even change, i dont think there is a reason for it since it makes writing lines back to the ifc a lot harder (or basically impossible seeing how many different lines there are)
  • Would it be possible to AT LEAST offer a function that does not do this?
@aka-blackboots
Copy link
Contributor

::take

@agviegas
Copy link
Collaborator

🟢🟢🟢

::take

Hi, @aka-blackboots! Thanks for taking this bounty! The due date is January 2, 2023 UTC.

If you need to submit some pull requests (PR) to complete the tasks, make sure that the last and only the last PR has a title that either starts with the bounty ID or is exactly the same as the bounty name. After the PR is merged, this bounty’s status will automatically changed to done.

If you do not need to make a PR, tell the manager @agviegas to run ::done command after your tasks is confirmed to be done.

Good luck!

@aka-blackboots
Copy link
Contributor

::drop

@agviegas
Copy link
Collaborator

🟢🟢🟢

::drop

Hi, @aka-blackboots! Thanks for giving it a try! It’s now once again available for anyone to take.

@quasarchimaere
Copy link
Author

::take

@agviegas
Copy link
Collaborator

🟢🟢🟢

::take

Hi, @quasarchimaere! Thanks for taking this bounty! The due date is January 2, 2023 UTC.

If you need to submit some pull requests (PR) to complete the tasks, make sure that the last and only the last PR has a title that either starts with the bounty ID or is exactly the same as the bounty name. After the PR is merged, this bounty’s status will automatically changed to done.

If you do not need to make a PR, tell the manager @agviegas to run ::done command after your tasks is confirmed to be done.

Good luck!

@quasarchimaere
Copy link
Author

::drop

@agviegas
Copy link
Collaborator

🟢🟢🟢

::drop

Hi, @quasarchimaere! Thanks for giving it a try! It’s now once again available for anyone to take.

@D4ve-R
Copy link
Contributor

D4ve-R commented Jan 31, 2023

::take

@agviegas
Copy link
Collaborator

🟢🟢🟢

::take

Hi, @D4ve-R! Thanks for taking this bounty! The due date is February 21, 2023 UTC.

If you need to submit some pull requests (PR) to complete the tasks, make sure that the last and only the last PR has a title that either starts with the bounty ID or is exactly the same as the bounty name. After the PR is merged, this bounty’s status will automatically changed to done.

If you do not need to make a PR, tell the manager @agviegas to run ::done command after your tasks is confirmed to be done.

Good luck!

@D4ve-R
Copy link
Contributor

D4ve-R commented Feb 19, 2023

@agviegas can be marked as done, same issues with github's resolve comment, sorry about that!

@agviegas
Copy link
Collaborator

🔴🔴🔴

Hi, @D4ve-R! The date is past due, your assignment has been revoked. It’s now available for anyone to take.

@agviegas
Copy link
Collaborator

@D4ve-R take this and I'll mark it as done. Sorry for the delay!

@D4ve-R
Copy link
Contributor

D4ve-R commented Feb 26, 2023

@agviegas no worries!

@D4ve-R
Copy link
Contributor

D4ve-R commented Feb 26, 2023

::take

@agviegas
Copy link
Collaborator

🟢🟢🟢

::take

Hi, @D4ve-R! Thanks for taking this bounty! The due date is March 19, 2023 UTC.

If you need to submit some pull requests (PR) to complete the tasks, make sure that the last and only the last PR has a title that either starts with the bounty ID or is exactly the same as the bounty name. After the PR is merged, this bounty’s status will automatically changed to done.

If you do not need to make a PR, tell the manager @agviegas to run ::done command after your tasks is confirmed to be done.

Good luck!

@agviegas
Copy link
Collaborator

::done

@agviegas
Copy link
Collaborator

🟢🟢🟢

::done

Hi, @D4ve-R! Thanks for your contributions! Please submit an expense to IFC.js Open Collective. Then, tell us the invoice number via the ::expense::_____ command (replace the _____ with the invoice number).

@D4ve-R
Copy link
Contributor

D4ve-R commented Mar 1, 2023

::expense::125715

@agviegas
Copy link
Collaborator

agviegas commented Mar 1, 2023

🟢🟢🟢

::expense::125715

Hi, @D4ve-R! Thanks for the confirmation! We’ll proceed to review the expense. Once it’s approved, the payment will be scheduled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants