Autodesk.Viewing.Extensions
Version 8 preview
This page documents a preview of the Viewer SDK v8. APIs and content can still change before the final release.
ModelStructureExtension
Adds a toolbar button for accessing the Model Browser panel.
Use its activate() method to open the Model Browser panel. The Model Browser is only available to 3D models.
The extension id is: Autodesk.ModelStructure
GuiViewer3D loads this extension by default.
Examples
viewer.loadExtension('Autodesk.ModelStructure')
Methods
Invoked automatically when the extension is loaded.
Invoked automatically when the extension is unloaded.
Invoked after the Toolbar UI gets created. Adds toolbar button.
Parameters
| toolbar* | toolbar instance. |
* Required
activate()
Opens the Model Browser UI.
deactivate()
Closes the Model Browser UI.
isActive()
Returns
| type | description |
|---|---|
| boolean | true when the panel is visible. |
setModelStructurePanel(modelStructurePanel)
Sets the panel instance to open when clicking the toolbar button. Use the API to override the default panel with a custom one.
Parameters
| modelStructurePanel* | The model structure panel to use, or null. |
* Required
Returns
| type | description |
|---|---|
| boolean | True if the panel, or null, was set successfully; false otherwise. |
restoreDefaultPanel()
Removes custom panel and restores the default one.