Search code examples
autodesk-forgeautodesk-viewer

What is viewer2D(or viewer3D).isolate exactly doing? And why it is necessary?


I am working on something similar to this demo

And I would like to know why viewer3D.isolate(...node?) of line 75 is necessary and why I should use it.


Solution

  • isolate is one of the viewer methods that can be used to visually distinguish one or more design elements, for example:

    • viewer.select(ids) can be used to select design elements; this will give them a specific selection color (blue by default) highlight
    • viewer.isolate(ids) can be used to isolate design elements; this will make any non-isolated elements semi-transparent or completely transparent (depending on your user settings)
    • viewer.setThemingColor(id, color) can be used to apply a custom color tint to specific design element

    As for the specific line viewer.isolate([]), this basically says "isolate nothing", or in other words, "reset isolation and make all objects visible again".