I've stumbled upon a problem while writing an iLogic rule that prompts the user to reselect an iLogic parameter value whenever an invalid selection is initially made.
Please see the attached part file that includes a simple example of this code. There are two iLogic parameters, each of which has values that I plan to select with the Multivalue pulldown list. Depending on the choice of High or Low for the "Range" parameter, only certain numbers are permissable for "Value".
The rule successfully catches unpermitted values when selected from the Multivalue pulldown list and prompts the user with a new list to choose from. Unfortunately, this re-selection only updates the "Equation" field in the iLogic Parameters table. The Multivalue column value remains the same (and invalid) value. If you click anywhere in the iLogic Parameter table, the rule again prompts the user to re-select a new value, but this time both the "Equation" and "Multivalue" fields are correctly updated.
Curiously, I've noticed that the rule works flawlessly if values are entered manually into the "Equation" column instead of choosing from the pulldown list.
Can anybody spot what I'm doing wrong? Is this a bug? I'm using IV2010 SP4
Solved! Go to Solution.
Solved by MjDeck. Go to Solution.
I don't know exactly why your rule doesn't work. But here's another way to do it:
' --------------------
MultiValue.SetValueOptions(True)
IF RANGE="LOW"
MultiValue.SetList("VALUE", 1, 2, 3)
END IF
IF RANGE="HIGH"
MultiValue.SetList("VALUE", 3, 4, 5)
END IF
' ---------------------
The SetValueOptions statement has this effect: when you change the multi-value list it will (if necessary) change the current value of the parameter to match something in the list. It chooses the value that is closest to the current value of the parameter. With this method, you don't have to pop up the InputListBox. The parameter is automatically set to something in the list.
Thanks, Mike!
I had considered a similar workaround, but I was missing the MultiValue.SetValueOptions(True) line to set a default value. This will work perfectly.