问题
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