39 switch cases or better way for variable points

Hello,

In my program there will be a variable to pick the starting location, which will have around 39 different points (or holes to deburr) where the program can start. Ofcourse I could use a switch with 39 different cases but I wonder, is there an easier way to have 39 waypoints saved but only use a small bit of code (in polyscope) to pick one based on a variable.

Thanks

Hi
Not sure if its easier but.
you could put all 39 poses into a list using the script node or assign node.
poseList = [p[1,2,3,4,5,6], p[6,5,4,3,2,1], … ]
and then use a waypont set to variable that calls
poseList[nr]
where the nr variable is a interger assigned in the start of program.

Best Regards CG1

2 Likes

yes, that looks like its exactly like what I want.

Thank you very much. I’ll try it out soon.