Get a list of all objects from loaded model

2019-08-18 19:21发布

I need to get all the properties from all the objects in the currently loaded model.

If I have a list of all the dbIds, I can use the Autodesk.Viewing.Viewer3D.getProperties(dbid,onSuccessCallback,onErrorCallback) method to retrieve them.

Is there a way to get a list of the dbIds of all the objects in the viewer? Or is there a better way to achieve this?

2条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-08-18 20:02

Here is how you can get all the dbIds in the model: Get all database id's in the model

Now we also have a function to retrieve properties for multiple elements in the Viewer: getBulkProperties method

I think the above two things are all you need.

查看更多
看我几分像从前
3楼-- · 2019-08-18 20:02

You can also use the following Model Derivatives API endpoint to get the list of all the properties for a model: GET :urn/metadata/:guid/properties

This can be done without loading the model in the viewer but needs to be performed server side for security reason. You can expose an endpoint from your own server to your webpage.

查看更多
登录 后发表回答