Task Automation with iLogic

Task Automation with iLogic

Forms

Forms can be used effectively without even using iLogic. A great example of this would be using a form on a parametric part model. You can have key driving parameters set up in the form to make it easy to adjust those parameters when needed.

A form can also be used to populate iProperty values. Setting up a form to show all the key iProperties needed to be filled is a great alternative to the lengthy setup of Vault Data Standards.

With both these examples it can be handy to use event triggers to have a form pop up at a specific interval.  Intervals such as “Before Save Document”, “After Open Document” are especially helpful as those tasks will always be done at some point, ensuring users see the form regularly.  It is important to note that Event Triggers don’t trigger forms, they can only trigger rules. So, a simple rule is needed to trigger the form.

iLogicForm.Show(“My Form Name”)

Just take the line above and paste it into an iLogic rule and then set the rule to the Event Trigger you plan to use.  The rule will need to be saved into a template or the master file, so that moving forward the forms will be in all your desired files.

External Forms

A global form is useful in the same ways that a form is useful, with one key difference – they are external to any file.  This is a big help if you read the first tip and thought: ’that’s great, but what about all my legacy data?’.  The global form can be set up and from then on it will be available on all documents within Inventor.

The downside here is that if you want to use a trigger to have the form show up, it could be a little trickier.  You may want to filter the document type in the trigger rule to make sure the form is appropriate to the document type.

Dim oDoc As Document = ThisApplication.ActiveDocument

If oDoc.DocumentType = 12290 Then ‘Part file

        iLogicForm.Show(“Form 1”)

Else If oDoc.DocumentType = 12291 Then ‘Assembly File

        iLogicForm.Show(“Form 1”)

Else If oDoc.DocumentType = 12292 Then ‘Drawing File

        iLogicForm.Show(“Form 1”)

End If

Parametric Referencing

The last of my tricks is a fundamental use of iLogic if you have a set of parametric parts that need to be in a subassembly to be relevant or perhaps if all the parts are driven with the same parameters. As long as there is nothing fancy like suppression, a simple master model (sub assembly) can be created with some very light iLogic use.

The process is simple. Start by creating the assembly and constrain all the parts together accordingly.  Then create user parameters for all the key driving parameters you plan to use. Once that’s done, create a new iLogic rule (I normally name this Reference).  This rule will just link the parameters of the assembly to the correct parameter in the part.

Parameter(“Front Plate:1”, “Length”) = Length

Parameter(“Front Plate:1”, “Width”) = Width

Parameter(“Back Plate:1”, “Length”) = Length

Parameter(“Back Plate:1”, “Width”) = Width

This can then be coupled with a form to access the parameters easily. It will also save time in opening or editing each part to update all the parameters.  Just edit the sub assembly, populate the form and all the parts in the model will update at once.