I trust initialization load two model in my viewer. For this I create two viewer and add for they html container where they initializing. Both of that model have itself toolbar. All is good, but some toolbar extensions don't loaded in viewers. I use this code in 6 version and all working good, but in 7 version I get this error list. This is image of console errors of browser. enter image description here
This is stack trace error.
ExtensionManager.js:399
Uncaught (in promise) Abort loadExtensionAsync('Autodesk.ViewCubeUi')
(anonymous) @ ExtensionManager.js:399
c.onload @ load-dependency.js:51
load (async)
o @ load-dependency.js:53
(anonymous) @ ExtensionManager.js:394
loadExtensionAsync @ ExtensionManager.js:393
loadExtension @ ExtensionManager.js:238
(anonymous) @ GuiViewer3D.js:445
setTimeout (async)
L.createUI @ GuiViewer3D.js:430
(anonymous) @ GuiViewer3D.js:276
(anonymous) @ GuiViewer3D.js:288
setTimeout (async)
(anonymous) @ GuiViewer3D.js:283
p @ Viewer3D.js:1199
(anonymous) @ SvfLoader.js:251
i @ WorkerCreator.js:182
This is my code, which initializing two viewer and loaded two model.
Autodesk.Viewing.Initializer(options, function (){
var htmlDiv = document.getElementById('MyViewerDiv');
var htmlDivSecond = document.getElementById('MySecondViewerDiv');
viewer = new Autodesk.Viewing.GuiViewer3D(htmlDiv, config3d);
viewerSecond = new Autodesk.Viewing.GuiViewer3D(htmlDivSecond, config3dSecond);
var startedCode = viewer.start();
if(startedCode > 0){
console.error('Faild to create a Viewer: WebGl not supported.');
return;
}
Autodesk.Viewing.Document.load(documentId,onDocumentLoadSuccess,onDocumentLoadFailure );
console.log('Initialization ....');
Autodesk.Viewing.Document.load(documentId1,onDocumentLoadSuccess1,onDocumentLoadFailure1 );
});
...
function onDocumentLoadSuccess(doc) {
console.log(doc);
var defaultModel = doc.getRoot().getDefaultGeometry();
viewer.loadDocumentNode(doc, defaultModel);
// Choose any of the avialble viewables
var svfUrl = doc.getViewablePath();
viewerSecond.start(svfUrl, onLoadModelSuccess, onLoadModelError);
}
I will be very grateful for your help.
Looks like Engineering has acted quickly and fix the issue - see here and here that all extensions load fine with dual Viewer instances:
const viewer = new Autodesk.Viewing.GuiViewer3D(document.getElementById('MyViewerDiv'));
const viewerSecond = new Autodesk.Viewing.GuiViewer3D(document.getElementById('MyViewerDiv2'));