简体   繁体   中英

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

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?

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: 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM