简体   繁体   English

鼠标单击vs viewer.select函数选择在Autodesk Forge多模型查看器中的行为有所不同

[英]Mouse click vs viewer.select function selection behave differently in Autodesk Forge multi models viewer

I have been working on multi-model from the last couple of weeks and found that selection of a model object using mouse click vs viewer select function behave differently. 我在过去几周一直在研究多模型,发现使用鼠标点击与查看器选择功能选择模型对象的行为有所不同。

I have two models one architectural and another mechanical. 我有两个模型一个建筑和另一个机械。 When I select a wall or room on the architectural model using mouse click, Object select with overlay without having any problem but when I try using viewer select function with same object, it hides behind the wall and overlay doesn't work. 当我使用鼠标单击选择建筑模型上的墙或房间时,使用叠加选择对象而没有任何问题但是当我尝试使用具有相同对象的查看器选择功能时,它隐藏在墙后面并且叠加不起作用。 It is only happening with the architectural model and working fine with the mechanical model. 它只发生在建筑模型中并且与机械模型一起工作正常。

Please suggest me if I am doing something wrong with multi-model. 如果我对多模型做错了,请建议我。

To programmatically select components when working with multiple models use viewer.select(dbid, model) : 要在使用多个模型时以编程方式选择组件,请使用viewer.select(dbid, model)

let model = viewer.impl.modelQueue().getModels()[index] or viewer.impl.findModel(modelId);
viewer.select(dbid, model)

And to get selected dbids use viewer.getAggregateSelection (see doc here ) the event to subscribe to AGGREGATE_SELECTION_CHANGED_EVENT (doc here ) to track selection changes: 要获取选定的dbids,请使用viewer.getAggregateSelection (请参阅此处的doc)事件来订阅AGGREGATE_SELECTION_CHANGED_EVENT此处为doc)以跟踪选择更改:

If the issue persists can you send some screenshots and your models (links via a sharing service like weTransfer/Dropbox) for further investigation over to forge.help@autodesk.com? 如果问题仍然存在,您是否可以发送一些屏幕截图和模型(通过共享服务链接,如weTransfer / Dropbox),以便进一步调查forge.help@autodesk.com?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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