web-ifc-viewer icon indicating copy to clipboard operation
web-ifc-viewer copied to clipboard

typesMap property

Open RASRC opened this issue 3 years ago • 5 comments

Hello everyone!

Today I installed the latest version of web-ifc-viewer in one of my apps.

For some reason, the property typesMap stop working and now it gives an error (the result of applying it is undefined).

Cap01

Cap02

It is something related to the upgrade? Is there a way to substitute that expression to obtain a similar result?

Thank you

RASRC avatar Apr 05 '23 21:04 RASRC

The entire file has been deleted in this commit. Depending on how you want to use all the types, there are probably more efficient ways to get them. Do you care to share your purpose/code?

Nomeon avatar Apr 06 '23 12:04 Nomeon

Sure.

Cap

The idea is obtaining the geometric types of the model (IFCSLABS, IFCCOLUMS, etc.), in the format that typesMap gived, that was an object with the number code of the type as key and the string name as the value.

Thanks!

RASRC avatar Apr 06 '23 15:04 RASRC

So this can now be acquired from the web-ifc api using the GetIfcEntityList method. i.e. viewer.Loader.ifcManager.getIfcAPI().GetIfcEntityList(modelID).

You need to provide your model ID as the list of ifc entities may be different depending on what schema your model is

beachtom avatar Apr 08 '23 07:04 beachtom

Hi @beachtom it gives me the following error:

Uncaught TypeError: Cannot read properties of undefined (reading 'ifcManager').

I made some changes to the expresion:

await viewer.IFC.loader.ifcManager.ifcAPI.GetIfcEntityList(model.modelID)

and gave me an array with ids, but they don't have the names of the types associated like typesMap property did.

Cap

RASRC avatar Apr 10 '23 15:04 RASRC

Sorry should have been viewer.IFC.Loader.ifcManager.getIfcAPI().GetIfcEntityList(modelID).

beachtom avatar Apr 10 '23 19:04 beachtom