iLogic Tutorial From Autodesk – 10

Create iLogic Rules in the Assembly

The following sections create a series of rules to manage the contents of the assembly. In these sections, we will provide excerpts of the rule text, which you can copy and paste into the iLogic rule editor. Keep in mind that it is always possible to utilize the helpers in the various tabs of the rule editor to assist you as you enter the rule text. We’ll provide notes to guide you to important areas as they’re introduced. It’s up to you whether you want to use the copy-and-paste approach, or whether you want to enter the rule text by hand.

The appendix at the end of this document provides the complete text of all of the rules.

Pass Parameters from the Assembly to the Parts

This model has a part with iLogic rules in it: manifold_block:1. We will need to pass the assembly level parameter to the part. To do this:

  • iLogic Assembly Rule Name DialogCreate a new rule named “assembly_to_parts_rule”

This rule sets corresponding parameters in the part based on the values of the control parameters in the assembly. Notice how we use the form of the Parameter function that specifies the component name, as well as the parameter name.

Parameter(“manifold_block:1”, “block”) = block
Parameter(“manifold_block:1”, “component_type”) = component_type
Parameter(“manifold_block:1”, “port_a_size”) = port_a_size
Parameter(“manifold_block:1”, “port_b_size”) = port_b_size
Parameter(“manifold_block:1”, “port_c_size”) = port_c_size

Press OK when you have completed this rule.

Editing Part Level Rules in an Assembly

In the Manifold Block Part tutorial we added a rule to the manifold block part to control changing from tee to elbow. This rule is great when we are just using it in the manifold block by itself, but we will need it at the assembly level as well. Instead of rewriting a rule that already exists, let’s copy the original.

  • Double click on manifold_block:1 from the model browser. (the other components should become transparent)
  • Click on the iLogic Tree Editor icon.
  • Double click on component_type_rule.
  • Highlight all of the rule text and copy it.
  • Cancel out of the rule editor.
  • Cancel out of the iLogic Tree Editor.
  • Double click on my_manifold_block.iam in the model browser
  • Add a new rule named “component_type_rule”.
  • Paste the rule text that we copied from the block’s component_type_rule into the rule editor. Your rule text should look like this:

If component_type = “standard” Then
port_b_size = port_a_size
port_c_size = port_a_size
End If

Now, click OK to save this assembly-level rule.

Inventor iLogic Tutorial Navigation

Intro123456789101112131415161718