xBimTeam / XbimWebUI

Web components for xBIM Toolkit
http://xbimteam.github.io/XbimWebUI/
Other
203 stars 121 forks source link

viewer.getModelState(modelId: number) #440

Open untecnologo opened 11 months ago

untecnologo commented 11 months ago

Hello, I hope you are doing well. I am having problems finding a definition of the result of the function in the title.

After I loaded the model I made a process to check all the elements loaded in the model in the viewer. For that I use Viewer.getModelState( modelId) This process returns an array of arrays. Example: [ [134, 65534], [135, 65534], [138, 65535] ]. The first number is the element ID as I can understand but the second number I am not sure where to find its definition or what it means. But I have noticed IFCZones are always 65534. Thank you for your kind support.

martin1cerny commented 11 months ago

First number is product ID, second is a number which combines state and style

result.push([map.productID, state + (style << 8)]);

It is meant to be as compressed as possible in case you want to store it. It works together with viewer.restoreModelState() which will reapply all the states and styles from the snapshot.

untecnologo commented 11 months ago

@martin1cerny Thank you very much for your time. I made also another question in a nother topic to see the possibility to get the version 6 due to I have some issues with the V5