Search code examples
autodesk-forgeautodesk-viewer

What event should be raised on "Hide Selected" for an aggregated model?


What event should be raised when I select some object in the Viewer and choose "Hide selected" in the context menu for an aggregated model?

For a single model it is HIDE_EVENT but it isn't raised for an aggregated model. I also checked maybe there is another event, something like AGGREGATE_ISOLATION_CHANGED_EVENT but didn't find anything suitable.


Solution

  • Please use Autodesk.Viewing.AGGREGATE_HIDDEN_CHANGED_EVENT instead for catching the hidden event in the model aggregation scenario.

    To do similar as "Hide selected" in the context menu for an aggregated model, we can call APIs in this way:

    let selSet = viewer.getAggregateSelection();
    viewer.impl.visibilityManager.aggregateHide(selSet);