Get a list of all objects from loaded model

邮差的信 提交于 2019-12-25 00:15:57

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/47571195/get-a-list-of-all-objects-from-loaded-model

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!