I updated
the WebGL and Forge introduction for BIM programming and
its GitHub source for
the presentations in the coming days at
the RTC Revit Technology Conference Europe and
the ISEPBIM Forge and BIM workshops at ISEP,
the Instituto Superior de Engenharia do Porto,
implemented two little curl
wrapper scripts to help me list the supported file formats, explored why they changed and updated the hackathon webinar overview.
Before getting to that, though, I'll also highlight a helpful little note by Christian on how to access the 'Symbolic Representation' setting:
- 'Symbolic Representation' setting parameter
- Forge intro for BIM programming
cURL
wrapper scripts to list Forge file formats- Updated Forge file formats
- Forge hackathon webinar series and Fusion 360 Client API recording
'Symbolic Representation' Setting Parameter
Christian shared how to access the 'Symbolic Representation' setting in a family definition in the Revit API discussion forum thread on symbolic representation - parameter:
just wanted to share some code as I "lost" one hour of my life to look for it. If you want to access the setting for "Symbolic Representation" inside a family document, here we go:
Parameter param = famdoc.OwnerFamily.get_Parameter( BuiltInParameter.FAMILY_SYMBOLIC_REP ); if( param != null ) { // 0 - From Family // 1 - From Project Setting param.Set( 1 ); }
Thank you very much for sharing that, Christian!
Forge Intro for BIM Programming
Forge for BIM Programming is a reveal.js presentation on WebGL and Autodesk Forge platform introduction.
It was first used for the BIM Programming conference and workshops in Madrid, January 2016, and now updated for the RTC Revit Technology Conference Europe and the ISEPBIM Forge and BIM workshops at ISEP, the Instituto Superior de Engenharia do Porto in Porto, October 2016.
For more information on Forge, please refer to the overview at forge.autodesk.com and all the technical details, samples and further documentation at developer.autodesk.com.
To view this presentation online, visit jeremytammik.github.io/forge_bim_programming.
cURL
Wrapper Scripts to List Forge File Formats
One of the slides in the presentation above lists the file formats currently supported by the Forge platform.
This list can be obtained by a REST call to the Forge Model Derivative API GET formats endpoint:
I had an temporarily insurmountable problem with Typepad crashing at this point... it was resolved by escaping the character c
using c
in all calls to the curl
command in the following scripts, i.e., replacing the string curl
by curl
. Weird, probably protects against some potential hack, and now solved...
You can look at what I actually intend to publish in the tbc GitHub repository, where this blog posts is mirrored as tbc/a/1486_webgl_forge_intro.html.
Sorry, I am unable to add the scripts inline to this typepad post.
Here they are as links instead:
OK, back to normal now, problem resolved...
curl -X 'GET' -H 'Authorization: Bearer ztcaB2R0f92bsV6iV0bSDgwmSVaW' -v 'https://developer.api.autodesk.com/modelderivative/v2/designdata/formats'
We need to supply a valid access token, though, instead of the placeholder listed above.
This in turn is obtained by a call to the authentication POST authenticate endpoint, specifying our client id and secret.
To easily complete this two-step process from the command line, I implemented two Unix shell scripts, forgeauth
and forgeformats
.
The former retrieves my client id and secret from two environment variables and calls the authenticate
endpoint like this:
#!/bin/bash curl -v 'https://developer.api.autodesk.com/authentication/v1/authenticate' -X 'POST' -H 'Content-Type: application/x-www-form-urlencoded' -d "client_id=$ROOMEDIT3DV3_PROD_CONSUMER_KEY&client_secret=$ROOMEDIT3DV3_PROD_CONSUMER_SECRET&grant_type=client_credentials&scope=data:read" echo "Now you might want to export FORGE_ACCESS_TOKEN=... for consumption by forgeformats"
This returns the following JSON formatted access token data:
{"access_token":"XzVxWJoVbNWcnJeKJPRnkYjp1tgt","token_type":"Bearer","expires_in":86399}
As the script suggests, I store the transient access token in another environment variable FORGE_ACCESS_TOKEN
:
$ export FORGE_ACCESS_TOKEN=XzVxWJoVbNWcnJeKJPRnkYjp1tgt
From there, it is retrieved by the second script, forgeformats
, which feeds it into the second endpoint like this:
#!/bin/bash curl -X 'GET' -H "Authorization: Bearer $FORGE_ACCESS_TOKEN" -v 'https://developer.api.autodesk.com/modelderivative/v2/designdata/formats'
Right now, that returns the following list:
{"formats":{"svf":["3dm","3ds","asm","catpart","catproduct","cgr","collaboration","dae","dgn","dlv3","dwf","dwfx","dwg","dwt","dxf","exp","f3d","fbx","g","gbxml","iam","idw","ifc","ige","iges","igs","ipt","jt","model","neu","nwc","nwd","obj","pdf","prt","rcp","rvt","sab","sat","session","skp","sldasm","sldprt","smb","smt","ste","step","stl","stla","stlb","stp","stpz","wire","x_b","x_t","xas","xpr","zip","prt\\.\\d+$","neu\\.\\d+$","asm\\.\\d+$"],"thumbnail":["3dm","3ds","asm","catpart","catproduct","cgr","collaboration","dae","dgn","dlv3","dwf","dwfx","dwg","dwt","dxf","exp","f3d","fbx","g","gbxml","iam","idw","ifc","ige","iges","igs","ipt","jt","model","neu","nwc","nwd","obj","pdf","prt","rcp","rvt","sab","sat","session","skp","sldasm","sldprt","smb","smt","ste","step","stl","stla","stlb","stp","stpz","wire","x_b","x_t","xas","xpr","zip","prt\\.\\d+$","neu\\.\\d+$","asm\\.\\d+$"],"stl":["f3d","fbx","iam","ipt","wire"],"step":["f3d","fbx","iam","ipt","wire"],"iges":["f3d","fbx","iam","ipt","wire"],"obj":["f3d","fbx","iam","ipt","step","stp","stpz","wire"]}}
Updated Forge file formats
Here is the list of extensions currently returned by call to the formats
endpoint shown above, cleaned up and alphabetically sorted:
- 3dm, 3ds, asm, asm, catpart, catproduct, cgr, collaboration, dae, dgn, dlv3, dwf, dwfx, dwg, dwt, dxf, exp, f3d, fbx, g, gbxml, iam, idw, ifc, ige, iges, igs, ipt, jt, model, neu, neu, nwc, nwd, obj, pdf, prt, prt, rcp, rvt, sab, sat, session, skp, sldasm, sldprt, smb, smt, ste, step, stl, stla, stlb, stp, stpz, wire, x_b, x_t, xas, xpr, zip
I compared that with the previous list that I generated in January:
- 3dm, 3ds, asm, bmp, cam360, catpart, catproduct, cgr, csv, dae, dlv3, doc, docx, dwf, dwfx, dwg, dwt, exp, f3d, fbx, g, gbxml, iam, 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
As you can see, support for quite a number of new formats has been added.
A few have also been removed, such as BMP and TIFF.
I asked for an explanation for that, and learned the following:
Here are the ones that seem to have been added:
- collaboration, dgn, dxf, idw, stpz
We assume it was easy (and made sense) to extend to more CAD-related formats such as dgn
, dxf
and idw
.
Stpz
is probably just compressed STP, so that was presumably a no-brainer, too.
The following have been removed:
- bmp, cam360, csv, doc, docx, jpeg, jpg, png, pps, ppt, pptx, rtf, sim, sim360, tif, tiff, txt, xls, xlsx
Aside from cam360
, sim
and sim360
, these are all Office or image formats.
Some were not actually supported by the Model Derivative service but are supported in the A360 product and its viewers.
This looks like good progress, to me.
Many thanks to Adam, Kean and Lee for their analysis, suggestions and clarifications!
Forge Hackathon Webinar Series and Fusion 360 Client API Recording
The Forge webinar series is nearing its end.
Here are the recordings and documentation pointers for the topics covered so far:
- September 20 – Introduction to Autodesk Forge and the Autodesk App Store
- September 22 – Introduction to OAuth and Data Management API – on OAuth and Data Management API, providing token-based authentication, authorization and a unified and consistent way to access data across A360, Fusion 360, and the Object Storage Service.
- September 27 – Introduction to Model Derivative API – on the Model Derivative API that enables users to represent and share their designs in different formats and extract metadata.
- September 29 – Introduction to Viewer – the Viewer, formerly part of the 'View and Data API', is a WebGL-based JavaScript library for 3D and 2D model rendering of CAD models from seed files, e.g., AutoCAD, Fusion 360, Revit and many other formats.
- October 4
– Introduction to Design Automation
– the Design Automation API, formerly known as 'AutoCAD I/O', enables running scripts on native CAD design files such as
DWG
, cf. Albert's tutorials. - October 6 – Introduction to BIM360 and the Forge DevCon recording on BIM 360 – BIM360 enables apps to integrate with BIM360 to extend its capabilities in the construction ecosystem.
- October 11 – Introduction to Fusion 360 Client API – Fusion 360 Client API implements an integrated CAD, CAM, and CAE tool for product development, built for the new ways products are designed and made; resources: forum, samples, learning material
For code samples on any of these, please refer to the Forge Platform samples on GitHub
at Developer-Autodesk
and Autodesk-Forge,
optionally adding a filter, e.g., like this for Design.automation
: ...Developer-Autodesk?query=Design.automation.
The Forge Webinar series continues during the remainder of the Autodesk App Store Forge and Fusion 360 Hackathon until the end of October:
- October 27 @ 8.00 AM PST – Submitting a web service app to Autodesk App store.
Please feel free to contact us at [email protected] at any time with any questions you may have on Autodesk Forge or the Autodesk Fusion 360 API.
We will be happy to work with you to resolve your issues 1-on-1.
Please note that the Q&A session 2 originally scheduled for October 20th 8.00 AM PST has been cancelled, since we will instead be working directly with developers who have issues or questions.
Quick access links:
- For API keys, go to developer.autodesk.com
- For code samples, go to github.com/Developer-Autodesk