Autodesk Forge Viewer-从"viewer.model.search"获取不同的值dbId和"viewer.getSelection()" [英] Autodesk Forge Viewer - Getting different values dbId from "viewer.model.search" and "viewer.getSelection()"

查看:175
本文介绍了Autodesk Forge Viewer-从"viewer.model.search"获取不同的值dbId和"viewer.getSelection()"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试隔离使用方法viewer.model.search搜索的某些元素,但是当我使用viewer.isolate方法时,所有内容都将隐藏.

我已经使用getSelection隔离元素,并且我注意到它们为同一元素提供了不同的dbId值.使用getSelection时,dbId有效,但使用search时,则不可用

有人有同样的错误吗?

更新3/11/2019:
当我试图弄清楚发生了什么时,我意识到search方法给您的数字减一,例如:如果您获得getSelection的数字​​2302,则search会给您2301.

这是一个错误吗?

解决方案

差异可能是由于那些 dbId's 代表了层次结构中不同级别上的相同元素.通过单击在 UI 中选择某项时,然后是叶子(层次结构树中的最低元素,通常为 body solid ).

您可以在层次结构 浏览器面板中检查选择了哪个确切节点:

也正在谈论这种现象,这是一篇有关覆盖在哪个级别上选择元素的文章: 选择替代

身体"和实体"叶实体的父代的dbId数通常比叶子本身的dbId少一,如下图所示:

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:

这篇关于Autodesk Forge Viewer-从"viewer.model.search"获取不同的值dbId和"viewer.getSelection()"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆