Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

viewer.getModelState(modelId: number) #440

Open
untecnologo opened this issue Dec 19, 2023 · 2 comments
Open

viewer.getModelState(modelId: number) #440

untecnologo opened this issue Dec 19, 2023 · 2 comments

Comments

@untecnologo
Copy link

untecnologo commented Dec 19, 2023

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
Copy link
Member

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
Copy link
Author

untecnologo commented Dec 20, 2023

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants