autocad - How to Show/View or Read .dwg files on browser -


how show or read .dwg files on browser without using software means using php, jquery, javascript or other programming language. have gone through https://developer.autodesk.com , created app client id , client secret, created index.html file. after stuck in finding next movement getting required "model derivative api". please guide me same. giving precious response.

<!-- viewer css --> <link rel="stylesheet" href="https://developer.api.autodesk.com/viewingservice/v1/viewers/style.min.css" type="text/css">  <!-- developer css --> <style>     body {         margin: 0;     }     #myviewerdiv {         width: 100%;         height: 100%;         margin: 0;         background-color: #f0f8ff;     } </style> 

<!-- viewer instantiated here --> <div id="myviewerdiv"></div>  <!-- viewer js --> <script src="https://developer.api.autodesk.com/viewingservice/v1/viewers/three.min.js"></script> <script src="https://developer.api.autodesk.com/viewingservice/v1/viewers/viewer3d.min.js"></script>  <!-- developer js --> <script>     var viewer;     var options = {         env: 'autodeskproduction',         accesstoken: '<your_application_token>'     };     var documentid = 'urn:<your_urn_id>';     autodesk.viewing.initializer(options, function oninitialized(){         autodesk.viewing.document.load(documentid, ondocumentloadsuccess, ondocumentloadfailure);     });      /**     * autodesk.viewing.document.load() success callback.     * proceeds model initialization.     */     function ondocumentloadsuccess(doc) {          // document contains references 3d , 2d viewables.         var viewables = autodesk.viewing.document.getsubitemswithproperties(doc.getrootitem(), {'type':'geometry'}, true);         if (viewables.length === 0) {             console.error('document contains no viewables.');             return;         }          // choose of avialble viewables         var initialviewable = viewables[0];         var svfurl = doc.getviewablepath(initialviewable);         var modeloptions = {             sharedpropertydbpath: doc.getpropertydbpath()         };          var viewerdiv = document.getelementbyid('myviewerdiv');         viewer = new autodesk.viewing.private.guiviewer3d(viewerdiv);         viewer.start(svfurl, modeloptions, onloadmodelsuccess, onloadmodelerror);     }      /**      * autodesk.viewing.document.load() failuire callback.      */     function ondocumentloadfailure(viewererrorcode) {         console.error('ondocumentloadfailure() - errorcode:' + viewererrorcode);     }      /**      * viewer.loadmodel() success callback.      * invoked after model's svf has been loaded.      * may trigger before geometry has been downloaded , displayed on-screen.      */     function onloadmodelsuccess(model) {         console.log('onloadmodelsuccess()!');         console.log('validate model loaded: ' + (viewer.model === model));         console.log(model);     }      /**      * viewer.loadmodel() failure callback.      * invoked when there's error fetching svf file.      */     function onloadmodelerror(viewererrorcode) {         console.error('onloadmodelerror() - errorcode:' + viewererrorcode);     }  </script> 

you can test online @ a360 viewer.

the code pointed out page, note how it's missing token , urn. in fact, following viewer tutorial you'll notice prepare file viewing tutorial.

in case you'll need back-end upload , post translation jobs, have samples @ our github account.

update

show models without programming: can share a360 models on website, here steps:

  1. go a360 , sign in (or sign up)
  2. use existing project or create new one.
  3. inside project, click on upload , select file on machine. translation process start automatically. or can use existing files on project.
  4. on top-right icon, click on "share" option. share icon
  5. on popup, go embed tab , select size. copy html , paste on website. embed html code

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -