If you have 10 minutes to spare, you can automate exporting step files with Autodesk® Inventor® ilogic.
Out of the box, Inventor ilogic includes some custom snippets. These snippets are “small” re-usable codes. These can be used "as is" with no edits. The snippet we are discussing today is the "Save As STEP file." All I've done is customized the original snippet so that the step is exported to a folder of my choice.
Let’s get started! This snippet can be added to any Inventor file. However, it will probably be best served if added to your .ipt and/or .iam templates. This way, any new part or assembly will always contain the snippet. In my example, I will be using an .iam template, but the steps will be the same for an .ipt template.
Open your template and add the ilogic browser:
Your Inventor browser should now look like this:
From the RULES tab, right-click below "Assembly1" and ADD RULE. I've named my rule "StepExport”. Click OK.
Copy the snippet from this txt file and paste it into the bottom right side of the window…then SAVE.
Your ilogic Edit Rule window should now look like:
I've made three changes to the original "Save as STEP file" snippet. I've added the following two lines:
trigger = iTrigger0
SavePath = "C:\StepFiles\"
…and changed the line that contains oData.FileName to
oData.FileName = SavePath & ThisDoc.FileName(False) & ".stp"
You can now change the SavePath to the folder where you would like to save your step files. It should look similar to:
SavePath = "D:\Engineering\StepFiles\"
Do not forget the trailing slash (\)!
(If you want the step file to be saved in the same folder as your original cad model, you only need to make 1 change to the original “Save as STEP file” snippet. Just add trigger = iTrigger0 to the first line.)
The snippet is ready to be tested. CLOSE the Edit Rule window. In Inventor, go to the MANAGE TAB – iLogic Panel and click iTrigger. Doing this will execute the StepExport rule and export the step file to the SavePath folder.
Check your SavePath folder. Although there is no CAD model in our template, a step file should have been created. You can now save and close your template file. Start a new model with your template and select iTrigger to create your step files!