This is not my day for iLogic, it seems.
I'm trying to suppress a hole feature based off of a reference parameter value, after setting the size of a model parameter. The problem is the reference parameter doesn't update during the rule.
Open the attached part file (Inventor 2010 format) and use the iTrigger button to run the rule.
Select 200 from the list to set the width.
The rule contains an if, then to set the hole supression:
trigger = iTrigger0 Width= InputListBox("Enter Width", MultiValue.List("Standard_Widths"), Standard_Widths, Title := "Widths", ListName := "Available Standard Widths") Parameter.UpdateAfterChange = True RuleParametersOutput() InventorVb.DocumentUpdate() if Center_Hole_Space >= 80 then Feature.IsActive("Hole2") = True Else Feature.IsActive("Hole2") = False End if iLogicVb.UpdateWhenDone = True 'display for test MessageBox.Show("Center_Hole_Space = " & Center_Hole_Space, "Test")
But the Center_Hole_Space parameter is always one step behind when switching sizes.
Any thoughts?
P.S. I've tried adding these one at a time or in combo with no luck:
Parameter.UpdateAfterChange = True
RuleParametersOutput()
InventorVb.DocumentUpdate()
Solved! Go to Solution.
Solved by BMiller63. Go to Solution.
Breaking out the if/then into a seperate rule should work. Here's another solution.
The problem is that parameters that appear as variable names in the rule (such as Center_Hole_Space in your rule) aren't "live" links. Within the rule, they're simple local variables. They get values from the Inventor model only at the time the rule starts. If the parameter is changed by something external to the rule while the rule is running, then you have to use the Parameter function to get the changed value.
You can do this by adding the line:
Center_Hole_Space = Parameter("Center_Hole_Space")
before the line:
If Center_Hole_Space >= 80 Then