Opinions

Autodesk Inventor API – Part 1

By Allen Gager

Recently a question was posted on InventorConnections.com asking how to create Materials in the Style Editor from data in an Excel spreadsheet. I thought this would be a perfect opportunity to take a look at the Autodesk Inventor Application Programming Interface or Inventor API.

The goal of this series of articles is not to teach you how to program. The goal is to introduce you to the idea of what is possible and how to find the proper resources and apply them to the task you want to accomplish. Now before we get too far along, I would like to introduce you to the first place you need to bookmark. This is one of my favorite stops on the web for Inventor API information. Mod the Machine belongs to Brian Ekins, the father of the Autodesk Inventor API. Here you will find top quality articles, how to’s and other well written, helpful resources. I would like to direct your attention to his article titled Beginning API.  Please note that the series starts at the bottom of the page with Inventor API Fundamentals 001 – Getting Started and works its way toward the top. Also check out Free Online Inventor API Training Class.

Usually the first candidate for writing code is a task that needs to be done repeatedly. The Materials example is in this category. The person has hundreds of materials defined in an Excel spreadsheet and would like to avoid the time it takes to retype all that information in to the Style Editor.

The next reason you may want to write code is to enforce a standard. This could be as simple as making sure that all the text placed in iProperties is capitalized. Or maybe you need to check a large number of factors that would be impossible otherwise. Take a look at i CHECK IT as an example.

Another reason may be that a large number of calculations need to be done. Whatever the case may be, there is probably a way to do it with the API. The first step is to define what you want to do, in simplest terms.  In our example we want to; obtain data from a spreadsheet and use it to create a Material in Inventor.

I have typically found that the pieces I need to create a project already exist. I just need to figure out which ones I need to put the puzzle together. I have just presented you with two pieces of this puzzle contained in the scope statement of our definition.

  1. Obtain Data from Excel
  2. Create an Inventor Material

In the next part of this series I will show you where to find these pieces and how to start fitting them together.

Go to Part 2