InputListBox while loop

InputListBox while loop

Anonymous
Not applicable
361 Views
2 Replies
Message 1 of 3

InputListBox while loop

Anonymous
Not applicable

I'm getting strange behavior from a while loop. I've got a multi-value list parameter called "Actions". While "04 - Exit" is not the selected parameter value, the rule opens an InputListBox which then runs a separate function, Fr_inp() based on the selection made.

 

If I run the rule and select "04 - Exit" the program ends as expected. However if I choose another action to perform, for example delete a component, after deleting the component the program returns to the while loop, brings up the InputListBox and now when I select "04 - Exit" the InputListBox reappears and I need to select it again to end the program. What am I missing?

 

 

Sub Main()
Action= " "
Action_list()
Bay_list()
While Action <> "04 - Exit"
Action = InputListBox("Select Action to be made in the assembly", MultiValue.List("Action"), Action, Title := "Action", ListName := "Select Action to be made")
MsgBox(Action)
RuleParametersOutput()
InventorVb.DocumentUpdate()
Fr_inp()
End While
MsgBox(Action)
iLogicVb.UpdateWhenDone = True
ThisApplication.ActiveView.Fit
End Sub

 

 

 

0 Likes
362 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

After some testing with MsgBox I can see that after selecting "04 - Exit" the program re-runs the whole Sub, which sets Action to "" again, which prompts the InputListBox to appear again. I don't understand why it does this the 1st time but not the second.

0 Likes
Message 3 of 3

Anonymous
Not applicable
Removing these two lines solved the issue. Apologies for wasting anyone's time.

RuleParametersOutput
() InventorVb.DocumentUpdate()
0 Likes