sábado, 24 de septiembre de 2022

How to hide toolbar buttons in Autodesk Forge Viewer?

 



First, we can print in console the toolbar variable in order to show controls values. These are the sections of the toolbar.


Each control:

  • navTools
  • measureTools
  • modelTools
  • settingsTools
Then, if we expand one of them we can see the buttons inside controls


To hide or to remove the camera button we can do this:

this.viewer.toolbar.getControl('navTools').removeControl('toolbar-cameraSubmenuTool');

Let's remove some more buttons and see how it is showed.

this.viewer.toolbar.getControl('settingsTools').removeControl('toolbar-propertiesTool');
this.viewer.toolbar.getControl('settingsTools').removeControl('toolbar-modelStructureTool');
this.viewer.toolbar.getControl('settingsTools').removeControl('toolbar-settingsTool');
this.viewer.toolbar.getControl('modelTools').removeControl('toolbar-explodeTool');




No hay comentarios:

Publicar un comentario