//replace with your own urns
this.urn_model1 = 'urn:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6eGlhb2RvbmctdGVzdC1jb21tb24vUmV2aXRuYXRpdmUtbGV2ZWwtNC5ud2Q';
this.urn_model2 = 'urn:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6eGlhb2RvbmctdGVzdC1jb21tb24vUmV2aXRuYXRpdmUtbGV2ZWwtMS5ud2Q=';
this.urn_model3 = 'urn:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6eGlhb2RvbmctdGVzdC1jb21tb24vUmV2aXRuYXRpdmUtbGV2ZWwtMi5ud2Q';
this.urn_model4 = 'urn:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6eGlhb2RvbmctdGVzdC1jb21tb24vUmV2aXRuYXRpdmUtbGV2ZWwtMy5ud2Q';
//model info array
this.modelArray = [ {modelName:'urn_model1',urn:urn_model1,modelObj:null},
{modelName:'urn_model2',urn:urn_model2,modelObj:null},
{modelName:'urn_model3',urn:urn_model3,modelObj:null},
{modelName:'urn_model4',urn:urn_model4,modelObj:null}];
//viewer object
this.viewer = null;
function start(){
//replace with your own token
var token = 'eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0.eyJjbGllbnRfaWQiOiJpWjJzdVlXUEp4dTdWaE05Y0hWME5aYTF2TTZsSWtvVSIsImV4cCI6MTUwNTMxMzMwMiwic2NvcGUiOlsiZGF0YTpyZWFkIiwiZGF0YTp3cml0ZSIsImJ1Y2tldDpjcmVhdGUiLCJidWNrZXQ6cmVhZCJdLCJhdWQiOiJodHRwczovL2F1dG9kZXNrLmNvbS9hdWQvand0ZXhwNjAiLCJqdGkiOiJ1Vmo3MlhFbUJGT3BBVElmRUpjRDE0UjhHRUlabWQxdzhBdDUyRVp6Q0pROUZYekhoWE1pUjdCOG9YMFRyc3haIn0.suHYxckEbhrqGP0QllPZO6ruGDtogEmsjoDzggNXBc4';
//option to initialize viewer.
var options = {
env: 'AutodeskProduction',
accessToken: token
};
//It looks the static function of Viewer does not support ES6
//still use ES5
Autodesk.Viewing.Initializer(options, function onInitialized(){
//get the viewer div
var viewerDiv = document.getElementById('myViewer');
//initialize the viewer object
viewer = new Autodesk.Viewing.Private.GuiViewer3D(viewerDiv,{
});
//load model one by one in...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.