Remove controls from the built-in toolbar

clipboard.png
how do I remove some controls from the default toolbar in forge viewer, such as removing the controls in the red line in the screenshot? The methods I"ve tried before are var group = viewer.toolbar.getControl ("navTools"); group.removeControl (" toolbar-orbitTools");
there is another one: viewer.getToolbar (). RemoveControl ("html tag id")
, but it doesn"t work. Can you have more details?

Mar.03,2021

there is nothing wrong with the test on my side, such as the attached picture, orbit,pan,zoom has been removed
if you really can't do it on the other side, you can consider removing all of it, and then add your own
https://codeshelper.com/q/10.


.

the operation on Toolbar must be completed after the Toolbar has been created. It is very likely that your problem is that Toolbar will operate on Toolbar before it is created, so it is recommended that the operation on toolbar can be placed in the TOOLBAR_CREATED_EVENT event. Refer to the following code :

  if (_viewer.toolbar && false) {
    _self.createMyUI()
  }else {
    _viewer.addEventListener(Autodesk.Viewing.TOOLBAR_CREATED_EVENT, _self.onToolbarCreated)
    console.log('Events are registered')
  }

Menu