Autodesk View and Data API: Rendering 3D in Your Browser

Before I dig in any more deeper to how to write apps with Autodesk’s APIs I’d like to show some demos and what problem(s) it’s solving.

Why we need to render 3D models in a browser

Autodesk is a computer aided design (CAD) software company. The company was founded with the product AutoCAD, still one of the most, if not the most influential CAD software. From then on it also offered many other software for more specific domain. E.g. Revit for architectural design, Inventor or Fusion for industrial design, Maya or 3ds Max for special effects in movies, etc.

If you’re not in this space, just think that most 3D designed objects, like the Herman Miller Aeron chair, or the San Francisco Bay Bridge, or Pixar movies, have some involvement with some Autodesk software. CAD is everywhere, it’s in buildings, it’s in computers, it’s in furniture, it’s in movies, it’s in every engineering student’s curriculum. In every single domain, there’s one or more different CAD software that caters exactly towards the industry for design. There’s a gazillion number of CAD software, from Autodesk and many other companies.

The problem with a gazillion of CAD software is that there are a gazillion of file formats they export to. When people in different domains have to work with each other, like in constructing a new building, the use case is often very clunky. When a new building is being constructed, there are architects that design the building, structural engineers to make sure the building won’t tip over, mechanical engineers who design the heating, ventilation and air conditioning (HVAC) system and plumbing system, electrical engineers that design the wiring, then there’s engineers that put everything together to make sure a electrical wires don’t go right through a water pipe. Every single team use a software of their choice that exports to different file formats.

There’s another problem: CAD software is very expensive. It’s in the thousand dollar per year range. So the person who created the design has no cheap way to give their work to their client, if they’re not looking at the same computer screen.

This is where the View and Data API comes in.
Continue reading Autodesk View and Data API: Rendering 3D in Your Browser

How To: Request an Access Token for Autodesk APIs with Node.js

In this post I’ll demonstrate how to set up a simple Node.js server that will return an access token for Autodesk’s Web Service APIs. Every time you run the app, you’ll get a response in your console that contains the token.

Authentication API

Authentication API(link goes to official documentation) takes a POST request that contains your client id and secret in the request body. It sends you an access token that would expire in 1799 seconds – that is 30 minutes, to perform operations with Autodesk’s Web Service APIs.

The request:

POST /authentication/v1/authenticate HTTP/1.1
Host: developer.api.autodesk.com
Content-Type: application/x-www-form-urlencoded
client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&grant_type=client_credentials

The response body should look like this:

{
  "token_type": "Bearer",
  "expires_in": 1799,
  "access_token": "Ttj3qdRiNRGQsu975PPXF578hzmP"
}

Now that we understood what the API does, let’s get started! If you’d like to skip the tutorial, all the code is in a GitHub repo.

Continue reading How To: Request an Access Token for Autodesk APIs with Node.js