May 19, 2020

Get iLogic Form information from Inventor documents

Many people who want to use the Design Automation API to drive Inventor models have documents with iLogic Forms in them. Those Forms can help highlight to users the parameters that should be used to drive the given model.  

So, it could be quite handy to be able to reuse those iLogic Forms. You cannot expose them directly in your web app, but you could extract the information from the Forms using a Design Automation WorkItem and based on the information create corresponding HTML components.

The following sample extracts all the document parameters and all the iLogic Forms with the picturesparameters and groups on them.
If you want to provide a closer match to the actual layout of the iLogic Form on your webpage, then you might also need to extract information about LabelsTab Groups, Rows, Empty Space and Splitter.    

If you prefer, you could also extract this information using an Inventor add-in. The part exposing the relevant functionality is in this file: 
https://github.com/adamenagy/iLogicFormExtractor/blob/master/iLogicFormExtractor/iLogicFormExtractorPlugin/iLogicUtility.cs

You can find the whole project here: 
https://github.com/adamenagy/iLogicFormExtractor

Note: by default the Design Automation for Inventor template will create projects with Any CPU platform setting. This way referencing Autodesk.iLogic.Core will cause issues when running the program:

DebugPluginLocally.exe Error: 0 : Processing failed. System.BadImageFormatException: Could not load file or assembly 'Autodesk.iLogic.Core, Version=24.20.31000.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'Autodesk.iLogic.Core, Version=24.20.31000.0, Culture=neutral, PublicKeyToken=null'

Just change the project platform to x64, as it is done in the above referenced sample project as well.

Related Posts