iLogic Tutorial From Autodesk – 10

Creating iLogic Rules – Continued

The Feature.IsActive function sets the activity state (suppression state) of a feature whose name is specified in quotation marks inside the parentheses. Assigning a value of True indicates that the flange hole is active (unsuppressed).

If holes = “flange” Then
Feature.IsActive(“flange_hole”) = True

When the flange option is chosen for the holes parameter, we only want the flange hole active. We must include a command that deactivates the base hole. We can do this by using the same method we just used to activate the flange hole

Go to the Rule Syntax tab and insert the Feature.IsActive(“featurename”) command in the next line of the rule. Now click the Features tab and this time select the base_hole feature from the model tree. Replace the “featurename” text with “base_hole”. Assign a value of false. These two lines turn on the flange hole and turn off the base hole. Your rule should look like this so far:

If holes = “flange” Then
Feature.IsActive(“flange_hole”) = True
Feature.IsActive(“base_hole”) = False

For the case where the base hole is to be activated, a similar strategy is employed; activate the base hole and deactivate the flange hole.

To start this portion of the rule, start with an ElseIf keyword. This can be entered by typing it directly, inserting it by clicking the ElseIf button at the bottom of the iLogic Rule Editor window, or double-clicking ElseIf from the list in the Keywords window on the Rule Syntax tab.

Typing in the iLogic rules.

To cover the third case, where no holes are required, we will use the same method. To reuse blocks of text, you can perform a copy and paste operation, and then change the pasted text as required.

Highlight the “re-usable” text as shown here. Press Ctrl-C to copy the text to the clipboard. Then, position the cursor at the end of the rule text, and press Ctrl-V to paste it.

If holes = “flange” Then
Feature.IsActive(“flange_hole”) = True
Feature.IsActive(“base_hole”) = False
ElseIf holes = “base” Then
Feature.IsActive(flange_hole”) = False
Feature.IsActive(base_hole”) = True

iLogic Tutorial Navigation

1234567891011121314151617181920

 

iLogic Intro One

Subscribe to Blog via Email

Top