How to using external iLogic rules?

Save iLogic rules in a part, assembly or drawing file, then save those rules in that document and use them every time you open the document.

You can save iLogic rules in a part, assembly and/or drawing template so that any new file created using that template will already contain any standard rules you want your users to use. This is a great way to work because it means you can create rules and then add them to every template, which means they are always available to users. If a rule needs to be updated, the template can be updated and the rule will be updated for all subsequent documents.

Another way to use iLogic rules is to use external rules, this is where iLogic rules lice outside of the Inventor document and are referenced by the user when needed. To add external rules, it’s as simple as:

First, you can configure search paths for external rules on the Tools ribbon in Inventor:

The iLogic configuration tool is on the extended menu, to access this menu you need to click the black arrow next to the option.

The iLogic configuration dialog allows you to add search paths for folders containing external rules. External rules are basically text files containing iLogic code and saved with the following extensions:

  • .iLogicVb
  • .vb
  • text

You can see in the example below that I added the folder with all the external rules:

Now that it’s configured, you can select the External Rules tab and right-click Add External Rule to add the rule to the graph:


By doing this, I created a link between the iLogic rules stored in the folder and the documents I added to it. I can run the rule at any time by right-clicking and selecting “Run Rule”:


You’ll notice that I have the “Edit Rule” option, which will open the rule in the iLogic editor. I can reload from file, which is useful for changing iLogic code in external text files. And I can also open the folder where the rules are saved and finally delete\detach the external rules from the list.

The last part of this is that I can call external rules from rules stored in the document. I can add some iLogic code in the template file that references external files and rules.

iLogicVb.RunExternalRule

You’ll notice that I only added the filename of the external rule, not the full path, because setting the iLogic Configuration to include the search path for my external rule takes care of the folders to look for (you can add multiple search files folder).

I hear you asking why am I doing this? Well, this means that the user doesn’t always need to attach rules when needed, but it provides flexibility if a rule needs to be edited or updated – making updates within an external rule quick and easy, and propagated to all that rule Link to documentation.

Leave a Reply