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
609 stars 185 forks source link

[Question]: How can I get IFC data such as name or other attributes? #873

Closed Philip2809 closed 3 months ago

Philip2809 commented 3 months ago

Hello!

I am very new to the IFC file structure and this web-ifc is awesome, I am wondering how I would be able to get IFC metadata from the file to three js based on expressId? For example, in IFC it says: #1295= IFCSITE('1b0aQcLSb6KP4cEKR_kZZp',#12,'Gelaende 0815','No real site','LandUse',#104,#1289,$,.ELEMENT.,(49,9,0,0),(8,43,0,0),0.,$,$); And I can find 1295 via web-ifc but I cant get the name or other attributes as shown with blenderbim: image

How can I get this info? If not possible can this feature be added?

beachtom commented 3 months ago

Hi - you should be able to use the GetLine method. This will return an object with all the IFC properties on it. Have you tried that?

Philip2809 commented 3 months ago

Hey! I am using version 0.0.40 right now, maybe that is too old? This is what I get with GetLine; image

beachtom commented 3 months ago

yes that should work - can you try the latest version?

Philip2809 commented 3 months ago

With version 55 I get the same doing it in the console, but using it in the code gives me correct? image image

However I also get ALOT of errors and the other IFC file I have, that one is 460mb it wont load in this version. Opening takes alot longer and then I think the console logs crash it? image

Philip2809 commented 3 months ago

The errors are on the small 10mb file

beachtom commented 3 months ago

I suspect the version in the console is not keeping the model in memory.

The model you get the errors will only effect the geometric views - you should still be able to get data from it?

Philip2809 commented 3 months ago

I was wrong, it did load but it took ALOT longer, over a minute, the old version took 10 sec to load the 460 mb file. The 10 mb file loads fast but with the errors as above.

Philip2809 commented 3 months ago

I can get the data from it, but why does it error? https://www.steptools.com/docs/stpfiles/ifc/AC20-Institute-Var-2.ifc This is the example file I use

beachtom commented 3 months ago

There are some meshes in that object we don't support yet.

Philip2809 commented 3 months ago

I see, thank you for helping me! Can you use web-ifc to modify these attributes?

beachtom commented 3 months ago

So yes - you can delete the line and then re-add it using the same express ID - but a note you cannot change the type of the line - if you change the type you must insert it with a new express ID

Philip2809 commented 3 months ago

It it possible to build a dir-tree with web-ifc in an easy way?

beachtom commented 3 months ago

web-ifc is quite low level. I believe the code for building the tree lives in the components repo. So you would need to look at that for inspiration

Philip2809 commented 3 months ago

Alright, thanks for you help, will look into it!