伪造观察者:取消选择事件

时间:2017-10-25 12:16:30

标签: autodesk-forge

尝试:

   this.viewer.addEventListener("selection", ( args )=>{
        if( condition )
            return false;
    });

但它不起作用。 是否有可能阻止某些条件的选择?

1 个答案:

答案 0 :(得分:0)

要完全取消选择,请使用此选项:

this.viewer.addEventListener(
 Autodesk.Viewing.AGGREGATE_SELECTION_CHANGED_EVENT, (args) => {

   if(condition) {

      this.viewer.clearSelection()
   }
})

要控制哪些组件可供选择,这是一个更难的主题,请参阅该文章:Controlling components selection in the Viewer

相关问题