Autodesk Forge Viewer - Getting different values dbId from “viewer.model.search” and “viewer.getSelection()”

萝らか妹 提交于 2019-12-24 08:09:25

问题


I'm trying to isolate some elements that I search with the method viewer.model.search but when I use the viewer.isolate method I get everything to hide.

I already use the getSelection to isolate elements and I notice that they give me different dbId values for the same element. With getSelection dbId works but with the search doesn't

Does that anyone have this same error?

UPDATE 3/11/2019:
While I was trying to figure out what happened, I realized that the search method gives you the number minus one, for example: if you get with the getSelection the number 2302, the search gives you 2301.

Is this a bug?


回答1:


The difference might be caused by those dbId's representing the same element at a different level in the hierarchy. When you select something in the UI by clicking on it, then the leaf (the lowest element in the hierarchy tree, usually a body or solid) is selected.

You can check in the Hierarchy Browser panel which exact node is being selected:

Also talking about this phenomenon, here is an article on overriding at which level an element is selected: Selection override

Edit: the dbId number of the parents of Body and Solid leaf entities tend to be one less than the dbId of the leaf itself as shown in this picture:



来源:https://stackoverflow.com/questions/55081846/autodesk-forge-viewer-getting-different-values-dbid-from-viewer-model-search

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