Design Review

Reply
Contributor
tagbagz
Posts: 21
Registered: ‎03-13-2012
Message 1 of 8 (1,956 Views)

DWF Viewer Javascript API

1956 Views, 7 Replies
08-15-2012 01:18 AM

There are a few examples of javascript code on the net for controlling the DWF viewer when embedded in a webapage. Is there a comprehensive guide to all available functionality.

I am looking for a way to make the Selection be turned on by default (or a method of controlling with javascript) without having to either select the arrow from the toolbar or use the right click menu.

 

Also does anyone know of a way to change the object params using javascript, I have tried modifying them with the DOM but it appears that once the dwf object is loaded the params cannot be changed without a complete page refresh.

 

Any help greatly appreciated

 

Paul M

Contributor
tagbagz
Posts: 21
Registered: ‎03-13-2012
Message 2 of 8 (1,943 Views)

Re: DWF Viewer Javascript API

08-17-2012 03:24 AM in reply to: tagbagz

Its OK I have found the solution by trial and error.

 

I would like to know however if there is a way in which the current selected object in the dwf viewer can be deselected using javascript, because selecting the currently  selected object does not  cause an event to fire

   

Thanks

PM

Contributor
tagbagz
Posts: 21
Registered: ‎03-13-2012
Message 3 of 8 (1,936 Views)

Re: DWF Viewer Javascript API

08-17-2012 08:13 AM in reply to: tagbagz

I have managed to find a solution to the above also.

What I would really like to know is if the properties palettes can be disabled so they do not pop up (if the user has them turned on)  when an object is clicked on.

I have tried various permutations of:

 

ADViewer.ECompositeViewer.Commands('OBJECTPROPERTIESBAND').Enabled = false;

but this does not seem to work

 

any help greatly apprecciated

 

PM

Active Contributor
vgottipa
Posts: 31
Registered: ‎02-10-2011
Message 4 of 8 (1,905 Views)

Re: DWF Viewer Javascript API

08-20-2012 07:40 AM in reply to: tagbagz

Try setting AdViewer.AutoOpenPalettesDisabled = 1

Contributor
tagbagz
Posts: 21
Registered: ‎03-13-2012
Message 5 of 8 (1,900 Views)

Re: DWF Viewer Javascript API

08-20-2012 09:41 AM in reply to: vgottipa

Many thanks that works great on the latest plug-in

does anyone know why the design review plug-in that gets downloaded from the Autodesk Website is the 2009 version?

 

is there a CAB file in existence anywhere for the 2012 or 2013 browser plug-in (the full design review download that includes the plug-in is over 700MB in size)

 

regards

Paul M

Member
BrunoMeier7845
Posts: 3
Registered: ‎09-20-2006
Message 6 of 8 (1,626 Views)

Re: DWF Viewer Javascript API

10-15-2012 10:02 PM in reply to: tagbagz

Can you Post the Solution, have the Same Quentin, how to change properties with the API. Thanks

 

Member
BrunoMeier7845
Posts: 3
Registered: ‎09-20-2006
Message 7 of 8 (1,625 Views)

Re: DWF Viewer Javascript API

10-15-2012 10:04 PM in reply to: tagbagz

Can you Post the Ideal, how to deselect all selected Objekts in the viewer. I can Not find any Event for that. Tanks 

New Member
mmemma
Posts: 3
Registered: ‎12-11-2012
Message 8 of 8 (299 Views)

Re: DWF Viewer Javascript API

06-05-2014 12:36 PM in reply to: BrunoMeier7845

There is this: http://through-the-interface.typepad.com/through_the_interface/2014/05/javascript-in-autocad-viewing...

 

but it's through Autocad, if you want something like freewheel used to be, use the 360 api? Which I do't think is out yet, but I'm assuming it works something like freewheel used to, tech preview: https://autodesk360.com/

 

using an iframe:

 

<iframe scrolling="no" frameborder="0" hspace="0" src="https://360.autodesk.com/Public/Embed?hash=be253600ed6e4b4089526e8436478836" width="430" height="619" allowtransparency="true" style="border: medium none;"></iframe>

 Personally I would use an <object> with an iframe fallback:

 

<!--[if !IE]>-->
   <object data="https://360.autodesk.com/Public/Embed?hash=be253600ed6e4b4089526e8436478836" type="text/html" style="width:100%;height:50em;" class="model">
      <p>Sorry. This content cannot be rendered (non-IE object).  Stop living in the past and upgrade to <a href="http://www.abetterbrowser.com">a better browser</a></p>
   </object>
<!--<![endif]-->

<!--[if IE]>
  <iframe src="https://360.autodesk.com/Public/Embed?hash=be253600ed6e4b4089526e8436478836" type="text/html" style="width:100%;height:50em;" class="model">
     <p>Sorry. This content cannot be rendered (IE iframe).  Stop living in the past and upgrade to <a href="http://www.abetterbrowser.com">a better browser</a></p>
  </iframe>
<![endif]-->

 

the endgame woulde be if you could include 

 

<script src="http://code.jquery.com/jquery-1.7.1.js"></script>
    <script src="js/three.min.js"></script>
    <script src="js/controls/TrackballControls.js"></script>
    <script
      src="http://app.autocad360.com/jsapi/v2/Autodesk.AutoCAD.js">
    </script>
    <script src="js/acadext.js"></script>
    <script src="js/threesolids.js"></script>

 on your own webpage and embed a div to view a model like

 

<div class="modelviewer"><object data="mysite/myfolder.model.dwf" type="text/html" style="width:100%;height:50em;" class="model">
   </object></div>

 

 

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.