ThatOpen / engine_components

MIT License
346 stars 134 forks source link

Creating new Pset in IFC4X3_ADD2 #438

Closed Can-Gr closed 2 weeks ago

Can-Gr commented 4 months ago

Describe the bug ๐Ÿ“

I am creating new pset in IFC4X3_ADD2 file but it gives me error of Cannot read properties of undefined (reading 'IfcGloballyUniqueId').

const { pset } = await propertiesManager.newPset(model, "New Field");

I tried the same code to create pset in IFC4, it works as expected and creates a new pset.

Reproduction โ–ถ๏ธ

No response

Steps to reproduce ๐Ÿ”ข

No response

System Info ๐Ÿ’ป

Browser : Chrome

Packages 
@thatopen/components: ^2.0.20,
@thatopen/components-front": ^2.0.19,
@thatopen/ui: ^2.0.8,
@thatopen/ui-obc": ^2.0.12,

Used Package Manager ๐Ÿ“ฆ

npm

Error Trace/Logs ๐Ÿ“ƒ

No response

Validations โœ…

HoyosJuan commented 4 months ago

Hey @Can-Gr! This was already solved in @thatopen/components@2.1.5. Closing this!

Can-Gr commented 4 months ago

Thank you very much @HoyosJuan ! It's working!

Can-Gr commented 2 months ago

@HoyosJuan After the library updated to its latest version, adding Pset doesnโ€™t work anymore.

It gives no error when code runs but when I download the model I canโ€™t see the new Pset or I canโ€™t even download the file in some versions (IFC4X3_ADD2) it gives me error of : Download failed: TypeError: Cannot read properties of undefined (reading 'IfcRelDefinesByProperties')

Old versions of library are :
"@thatopen/components": "^2.1.21", "@thatopen/components-front": "^2.1.23", "@thatopen/ui": "^2.1.3", "@thatopen/ui-obc": "^2.1.6",

HoyosJuan commented 2 weeks ago

Hey @Can-Gr! I'm testing this right now with a IFC4X3_ADD2 model and have created (and downloaded) the pset in the model successfully. ๐Ÿค” How are you creating the pset?

HoyosJuan commented 2 weeks ago

I've just realized the pset and the properties gets created... but they are not assigned to the elements. Is that the same behavior you have?

Can-Gr commented 2 weeks ago

Hey @HoyosJuan! I can create new pset, it's property and value to that property and assign it to the element successfully. Because when I check pset properties with model.getProperties of selected element, after I get the psets of that element with indexer.getEntityRelations, I can see everything.

And then I download the new model with a button. This works in every version(so far) except IFC4X3_ADD2.

HoyosJuan commented 2 weeks ago

Got i! Discovered the problem. Is solved now and it's already available in @thatopen/components@2.3.14. Let me know! Will close this.

Can-Gr commented 2 weeks ago

Hey @HoyosJuan, thank you, now I can create pset and download it and new pset is visible in the right element with right value.

However.. In any version of IFC, when I create a new pset and then delete it (which deletes successfully in the model) and then download it, I receive error of :

Download failed: RuntimeError: memory access out of bounds at web-ifc.wasm:0xcb64c at web-ifc.wasm:0xca2a2 at Object.RemoveLine (eval at newFunc (web-ifc-api.js:6010:1), :9:1) at IfcAPI2.DeleteLine (web-ifc-api.js:72239:1) at me.saveToIfc (index.mjs:11363:1) at async downloadFile

When I delete any existing pset, which comes with the model, and then download it, there's no error.

I've tested it with different versions and sizes.

HoyosJuan commented 2 weeks ago

Hey @Can-Gr! Seems to be a different problem than the one from this issue. May you create another different issue with this, please? Thanks!

Can-Gr commented 2 weeks ago

Hi @HoyosJuan, alright I've opened it.