Getting Started

use the 3d viewer api to embed the 3d viewer in your web applications using jquery ? more information on using jquery with the 3d viewer using jquery docid 18q6qater8drakqldyxsl installation 1\ add the 3d viewer to your project include the 3d viewer in your html file using a script tag, this will add the global bimsync object to the window object 2\ provide a container for the 3d viewer create a div element for attaching a 3d viewer instance to 3\ initialize the 3d viewer api set a callback function and then invoke the load method, the 3d viewer is ready once callback invoked bimsync setonloadcallback(onviewer3dload); bimsync load(); 4\ create a 3d viewer instance provide the div element and an options object to the constructor method const viewer3delement = document getelementbyid("viewer 3d"); const viewer3doptions = { textrendermode "dom", }; const viewer3d = new bimsync viewer3d viewer3d(viewer3delement, viewer3doptions); 5\ interact with the 3d viewer call methods on the 3d viewer instance to interact with the 3d viewer viewer3d loadmodelsfromtoken(tokenurl) then(() => { const objects = viewer3d getobjects(); if (objects length > 0) { viewer3d select(objects\[0] id); } }); usage options adjust the default behavior of the 3d viewer by providing an options object when creating a 3d viewer instance properties name type default description activeclippingplanebordercolor string or number #2ab77c sets the css color of the active clipping plane border antialiasingsamples number 0 the number of samples used for anti aliasing elevationspeed number 1 5 the elevation speed in meters per second enableclippingplanewidget boolean false enable or disable the clipping plane widget enabletouch boolean false enable or disable touch event interaction fieldofview number 60 camera frustum vertical field of view in degrees loglevel number 2 the level of logging used navigationmode string or map\[array\[object]] orbit the navigation mode used navigationorbitspherecolor string or number #b1d059 color of the sphere in orbit navigation mode rotationspeed number 40 the rotation speed in degrees per second selectedcolor string or number #a7f555 sets the css color of selected objects textrendermode string canvas the text render mode translucentopacity number 0 05 the opacity of translucent objects walkspeed number 3 the walking speed in meters per second navigationmode the navigation mode to use find out more about navigation modes setnavigationmode docid\ xppns3dnxbhsbjfaivezv loglevel the level of logging to display valid values are 0 no logging 1 error 2 warning 3 info 4 debug textrendermode the text render mode used valid values are canvas renders text as a texture on a sprite in the viewer canvas dom renders text using html elements producing a higher quality text