Switch AutoDesk Forge Viewer Environment from Local to AutodeskProduction

落花浮王杯 提交于 2021-01-29 14:33:04

问题


We are using autodesk-forge viewer to show 3D Models, We have a requirement as to load the models from the local environment and the auto desk cloud environment

Previously we are using only local environment, Viewer initialized with the "env":"Local"

let initOptions = {
  'env': 'Local'
  'language': 'en'
}

Autodesk.Viewing.Initializer(initOptions)

Now we need to switch between the Local Environment and AutodeskProduction, is that Possible?

To achieve switching, what cloud i have to do.

Have to re-Initialize the Viewer with new env?

Please help me...


回答1:


Simply terminate/finish the previous/existing Viewer and re-initialize as you normally would all over again:


Autodesk.Viewing.Initializer( {'env' : 'Local', getAccessToken: 
  //...
}, () =>{
   // viewer = ...

  })             
})

//...

viewer.finish()


Autodesk.Viewing.Initializer( {'env' : 'AutodeskProduction', getAccessToken: 
  //...
}, () =>{
   // viewer = ...

  })             
})



来源:https://stackoverflow.com/questions/62234001/switch-autodesk-forge-viewer-environment-from-local-to-autodeskproduction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!