ThatOpen / engine_web-ifc

Reading and writing IFC files with Javascript, at native speeds.
https://thatopen.github.io/engine_web-ifc/demo
Mozilla Public License 2.0
637 stars 204 forks source link

WriteLine only works for existing Lines #290

Closed quasarchimaere closed 1 year ago

quasarchimaere commented 1 year ago

https://github.com/IFCjs/web-ifc-three/blob/f88394d0d32371631aa0e79fe768125966941353/web-ifc-three/src/IFC/web-workers/workers/WebIfcWorker.ts#L156

        const object = this.webIFC.GetLine(modelID, serializedObject.expressID);
        Object.keys(serializedObject).forEach(propName => {
            if(object[propName] !== undefined) {
                object[propName] = serializedObject[propName];
            }
        })

As one can see in the Code above, WriteLine only works for Existing Lines, this is due to the fact that everytime we write a Line we retrieve one with the given expressID, and in case of a non existing Line it returns the line with expressID 1 which is probably a line that is not going to reflect the structure we seek

D4ve-R commented 1 year ago

::take

agviegas commented 1 year ago

🟒🟒🟒

::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 commented 1 year ago

should be fixed, with this pr #315. Realized to late this was a bounty. To write new lines, simply create a lineObject with expressID < 0. I haven't tested the behavior for non existent lines for GetLine. If true this could be a big issue because of unintentionally overwriting something. I can test that and create a separate issue, if it turns out to be one.

D4ve-R commented 1 year ago

@agviegas, can be marked as done

agviegas commented 1 year ago

::done

agviegas commented 1 year ago

🟒🟒🟒

::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 commented 1 year ago

::expense::122016

agviegas commented 1 year ago

🟒🟒🟒

::expense::122016

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

agviegas commented 1 year ago

🟒🟒🟒

Hi, @D4ve-R! Your expense has been approved!

agviegas commented 1 year ago

πŸŽ‰πŸŽ‰πŸŽ‰

Hi, @D4ve-R! Thanks for your contributions! The reward of this bounty has been transferred to your Open Collective account.