Suppress based off of a reference parameter

Suppress based off of a reference parameter

Anonymous
Not applicable
750 Views
2 Replies
Message 1 of 3

Suppress based off of a reference parameter

Anonymous
Not applicable

This is not my day for iLogic, it seems. Smiley Sad

 

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()

 

 

0 Likes
Accepted solutions (1)
751 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Accepted solution

update:

 

I resolved this by breaking the if/then out into an seperate rule.

0 Likes
Message 3 of 3

MjDeck
Autodesk
Autodesk

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


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes