Controlling Layer Visibility using Autodesk Design Review API

<?xml encoding=”UTF-8″>By Partha Sarkar

If you want
to control the layer visibility of a DWF file embedded in a Web Page using Autodesk Design Review JavaScript
API, you can access the Layers property from the DWF Viewer control object and
for a specific layer in the layer list you can set the Visible property to true
or false to show that layer or to switch it off.

Here is a relevant
JavaScript code snippet – 

function LayerON(){ <br><br><span>// Switching a Layer ON</span><br><span>// DWFViewer is DwfViewer Object that represents the DWF Viewer control</span>
DWFViewer.Viewer.Layers.Item(2).<strong>Visible</strong> = <strong>true</strong>; 
<br>//<br>}<br><br>function LayerOFF(){ 
<br><span>// Switching a Layer OFF</span><br><span>// DWFViewer is DwfViewer Object that represents the DWF Viewer control</span><br>
DWFViewer.Viewer.Layers.Item(2).<strong>Visible</strong> = <strong>false</strong>;  
<br>}

 


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading