The Building Coder

Forge Formats, Webinars and Fusion 360 Client API

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

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.

Forge platform diagram

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:

I compared that with the previous list that I generated in January:

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:

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:

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:

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:

Please feel free to contact us at forgehackathon@autodesk.com 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:

Forge – build the future of making things together