<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=445056146107513&amp;ev=PageView&amp;noscript=1">

Getting Started with Inventor Automation and iLogic

Mike Space

So, you have decided to explore automation for some of your regular tasks in Autodesk Inventor®. Where do you start? What is involved? How do you use it? First, let's explain what iLogic is.

Autodesk says this:

“iLogic is a functionality of Inventor that allows users and administrators to create logic in the form of VB.net to accomplish tasks. Rules are developed and organized using snippets and other code writing statements to run at given times to consistently do some of the work engineers and designers need to do.”

iLogic can help you save time, increase efficiency, ensure standards are followed, and much more. That said, you need to be thoughtful about creating the automation code. Below are some of the areas to consider.

Internal vs. External rules

iLogic Rules come in two flavors, Internal Rules and External Rules. Either type of rule is created similarly within the context of Inventor in the iLogic Browser.

Internal Rules are stored within the file and are exposed and accessible to the users with permission to access them. External Rules are stored in a directory either locally on a user system or central on a server, geographically agnostic.

Parameters or Properties

Inventor files can store data in several places:

  • Model Parameters
  • User Parameters
  • Reference Parameters
  • Linked Parameters
  • iProperties

Which one is best to use? That often depends on what you are using it for. No rule says what to use and when.

Coding the Rules

Whenever anyone gets started in coding, it is easy to get lost in a sea of terms that can be confusing. (Variables, Shared Variables, Conditional Loops, and Expressions.) It can seem like a foreign language at times. Once you understand these terms, creating your first rule can be much less daunting.

Example

Let's take a look at a simple rule for creating a pdf file:

   'Gets the Workspace Path
WorkspacePath= ThisDoc.WorkspacePath()
   'Gets the Length of the WorkspacePath String
WorkspacePathLength = Len(WorkspacePath)
   'Gets just the Path of the file
PathOnly = ThisDoc.Path
   'Removes the Workspace Path from FullPath
DirectoryPath = Strings.Right(PathOnly, PathOnly.Length-WorkspacePathLength)
   'Sets the Directory that the PDF should be saved in
PDFPath = "D:\PDFs\" & DirectoryPath
   'Checks to see if that directory exists. If not, it is created
If(Not System.IO.Directory.Exists(PDFPath)) Then
   System.IO.Directory.CreateDirectory(PDFPath)
End If
   'Saves the PDF in the desired location
ThisDoc.Document.SaveAs(PDFPath & "\" & ThisDoc.FileName(False) & (".pdf") , True)

 

This code sets a few variables, checks to see if the output directory exists, and then saves the file as a PDF.

Where to Start

The best way to start with iLogic is to get some training. Hagerman offers training with iLogic as well as consulting on automation projects.

An iLogic class covers topics such as:

  • Introduction to iLogic
  • Understanding Parameters and Equations
  • Rule Creations
  • Working with Conditions Statements
  • Much more

Automation Consulting

Hagerman’s expertise in iLogic and automation can help you:

  • Capture user inputs in easy-to-use forms
  • Automatically generate all required drawings, models, documents, and data
  • Provide systems for use by designers, sales staff, distributors, or  customers
  • Automate design and drafting in both 2D and 3D CAD formats
  • Output any other required data and documents, including quotes, proposals, material lists, etc.
  • Integrate with ERP and other in-house company databases
  • Upgrade current solutions to be compatible with the latest versions of AutoCAD®, Revit® or Inventor®

If you are ready to check out if automation and iLogic can help you, contact your Hagerman representative today. We can help you save money and time and reduce errors in your design cycle.

Comments