Search code examples
treeviewselectionautodesk-viewerforgegetselection

Problems with SELECTION_CHANGED_ EVENT in Forge Viewer v7*


I have a problem when I upgraded Forge Viewer from v6* to v7* with SELECTION_CHANGED_ EVENT, everything is working fine if I select the object from the Viewer, but when I select the object from the Model Browser the getSelection method returns empty. This works fine in the v6* but not in v7*.


Solution

  • The model browser behavior has changed in v7. You'll notice that clicking an object in the model browser now isolates it instead of selecting it. So, for your original use case, consider listening to the Autodesk.Viewing.ISOLATE_EVENT event, or to the Autodesk.Viewing.AGGREGATE_ISOLATION_CHANGED_EVENT event.