iLogic Tutorial From Autodesk – 16

iLogic Rule #3 – Bracket Dimensions

Clicking the dropdown menu in the Multivalue field in the mass row in the Parameter Editor reveals the list of values for the mass parameter.

Creating a Multi Value iLogic Parameter.

Click Done to complete the modification of the mass parameter. Now we’re ready to create an iLogic rule that will drive the bracket width.

Add the iLogic Rule

Click the Add Rule icon on the iLogic ribbon panel. Name the rule “Width_Rule”. In the text window of the Rule Editor, start with an If statement. If the mass is 100, we want the bracket to be 1 inch wide. Locate the parameter called bracket_width by clicking on the Model Parameters node in the model tree. The list of model parameters will be displayed in the window at the top right of the Rule Editor.

Double-click on bracket_width in the parameter list to insert the parameter name into the rule text. Parameter names can be directly typed into the rule, but double clicking from the list to insert them eliminates the possibility of spelling errors.

Using the double click method of iLogic parameter creation.

Set the bracket with to 1 inch:

If mass = 100 Then
bracket_width = 1

It is possible to specify units in iLogic numeric expressions (e.g., “1 in”). However, we don’t demonstrate that in this tutorial for the sake of simplicity. When units are omitted, the units specified in the model’s document properties are assumed.

In the case where the mass = 200, the width should be 2 inches. Use an ElseIf statement to set the bracket_width to 2 inches when the mass is 200. The rule should look like this:

If mass = 100 Then
bracket_width = 1
ElseIf mass = 200 Then
bracket_width = 2

Now use two more ElseIf statements to cover the remaining value cases. End the iLogic rule with an End If statement. The complete rule, covering all possible values for mass, should look like this:

If mass = 100 Then
bracket_width = 1
ElseIf mass = 200 Then
bracket_width = 2
ElseIf mass = 300 Then
bracket_width = 3
ElseIf mass = 400 Then
bracket_width = 4
End If

Click OK on the Rule Editor dialog to save this new rule. Next, we’ll exercise it.

iLogic Tutorial Navigation



iLogic Intro One

Subscribe to Blog via Email