How to jump to a certain line in the program via Script or Assignment

Hello, all

Is there anyway to have a program jump to a certain line in the program tree using Script or Assignment commands? Picture attached below:


I would like if “Restart=True”, to then jump to line 76 in the program tree (start back over at MoveL, T2Approach.

Bonus question: if there is also anyway I can add to the “count” in the palletization program, both when the condition is and isn’t met.

Thank you all again in advance for your help. I wasn’t able to find anything in the PolyScope Script manual.

There is not an explicit jump command, no. You can, however, put everything from line 76 on in a loop, and loop while restart == True instead. Then any code after this loop would only execute when restart == False. This should accomplish what you’re looking for.

As for adding to the count, if I’m understanding you right, all you have to do is just use an Assignment node and say var = var + 1. Logically, it sounds like you’re asking if(True OR False) which is ALWAYS true. Therefore you don’t need to make it a conditional at all, just increment the variable on its own line all the time.

2 Likes