How to set default initialization tool in Autodesk Viewer when loading a model?

31 views Asked by At

Upon initiating the model within the viewer (utilizing viewer version 7.95), the preset tool activated by default is the orbit tool, I want to alter this to the pan tool, just exec viewer.toolController.activateTool("pan") when loading a model could throw an error because toolController's not avaliable.

1

There are 1 answers

0
varunpatil On BEST ANSWER
viewer.addEventListener(Autodesk.Viewing.GEOMETRY_LOADED_EVENT, async () => {
   viewer.toolController.activateTool("pan")
})

In my testing TOOLBAR_CREATED_EVENT didn't work, so we have to rely on GEOMETRY_LOADED_EVENT.