Well, actually just one way, and a very simple one at that, but over fifty different model file formats... (thanks anyway, Paul)...
Instantly view your designs online – no software required.
I pointed out repeatedly how easy the Autodesk View and Data API makes it to interactively view and explore a 3D model in the browser without any further software whatsoever.
Now the new A360 Viewer Widget simplifies it further still, using a widget that can be embedded in web pages to view design files that are dragged and dropped onto it, enabling you to view them as you would in A360 inside any web page.
Try it out!
Drop a model file of your choice onto this widget:
Addendum: Oops. As explained by Stephen, you might notice that the embedded widget works fine on its home page for all browsers, but drag and drop on Typepad (i.e. the widget above) apparently only works in Chrome. The widget should work fine on your own webpage, just not in a (Typepad) blog. We've reported the problem to the dev team.
How is this achieved?
It is just an empty HTML div
element with an arbitrary id attribute defined, e.g., id="a360widgetDropAreaContainer"
that is initialised by calling the adskViewerWidget.Init
function on it like this (copy and paste to a text editor or view source to see the truncated lines in full):
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script type="text/javascript" src="https://api.autodesk.com/content/gateway/2013.1.363776.288/z/Scripts/a360Viewer/widget.js"></script> <script type="text/javascript"> var adskViewerWidget = adskViewerWidget(); adskViewerWidget.Init('#a360widgetDropAreaContainer', true); </script>
Dropping a file onto the widget opens a new window. It may take a minute or two for a moderately sized model to translate and display, looking something like this when done:
There are two ways to render the widget.
Above, only the pure drop area is displayed.
You can also display the full widget including an instruction blurb by leaving off the second true
argument:
You can use this for CAD model files such as DWG from AutoCAD, RVT from Revit, IPT, DWF, formats from SolidWorks, ProE, Catia and others, including large and complex files, all right in your browser with no downloads or plug-ins needed. 2D and 3D designs in over 50 file formats are supported.
I recently mentioned how to retrieve the full list of file formats yourself, and just suggested adding that functionality as an enhancement to the cURL workflow sample. Here they are:
- 3dm 3ds asm bmp cam360 catpart catproduct cgr csv dae dlv3 doc docx dwf dwfx dwg dwt dxf exp f3d fbx g gbxml iam idw ifc ige iges igs ipt jpeg jpg jt model neu nwc nwd obj pdf png pps ppt pptx prt rcp rtf rvt sab sat session sim sim360 skp sldasm sldprt smb smt ste step stl stla stlb stp tif tiff txt wire x_b x_t xas xls xlsx xpr zip
Oops, correction!
I tested viewing a DOC and a PNG file, listed above, and both of them failed.
The response from the call to the View and Data GET /viewingservice/{version}/supported
API is actually a bit more complex than I had initially assumed. I cannot just grab all extensions returned, because some of them are supported for extraction only, not viewing.
The file formats that can be viewed are identified by the channel mappings specified for them.
I can extract them from the data 'a' returned by the supported
API using a Python snippet like this:
channel_mappings = a['channelMapping'] keys = channel_mappings.keys() keys.sort() for x in keys: if channel_mappings[x].startswith('view'): print x,
That returns the following 57 supported viewable formats:
- 3dm 3ds asm cam360 catpart catproduct cgr dae dlv3 dwf dwfx dwg dwt dxf exp f3d fbx g gbxml iam idw ifc ige iges igs ipt jt model neu nwc nwd obj prt rcp rvt sab sat session sim sim360 skp sldasm sldprt smb smt ste step stl stla stlb stp wire x_b x_t xas xpr zip
Many thanks to Shiya Luo for pointing this out!
Stephen Preston already discussed this presenting a widget for the A360 viewer, and Kean Walmsley picked it up as well in viewing 50+ design software formats from a web page.
As said, the full instructions for embedding this are available at 360.autodesk.com/viewer/widget.
Note the typo there, though: the initialization call is adskViewerWidget.Init()
with a capital 'I'.
Enjoy!