In the iLogic Basics tutorial, you learned that you can use parameter names from a model as variables in a rule. Also, you can select from lists of available parameters, as well as features and other model entities, for inclusion in a rule.
Now, we define a set of rules that drive the geometry of our model based on the values of the key parameters we defined previously. In this lesson, we construct each rule in segments. The entire text of all the rules can be found at the end of this tutorial.
The first rule makes model changes to the Port B features, based on whether the elbow or tee block is selected. To make this change, suppress or enable the Port B features based on the type of block.
If block = “tee” Then
Feature.IsActive("Port_B") = True Feature.IsActive("Port_B_Threads") = True
We have now defined the behavior of our model for a tee block.
ElseIf block = "elbow" Then
Feature.IsActive("Port_B") = False Feature.IsActive("Port_B_Threads") = False
A simple way to add these lines is to copy and paste the text for the tee block behavior. Then change True to False in the new lines.
That’s it! All the instructions necessary to enable or disable the Port B features based on the type of block being used are included.