The number of CUTENDs needs to match the number of CUTs (CUTPLANE, CUTPOLY, CUTSHAPE, etc.).
If they don't match I am pretty sure you will get error messages.
If you are unsure of the number of cuts being performed because of looping in your script, then you can create a counting variable that increases by one every time you have a CUT command.
i.e.
CUTPOLY .....
cut_count = cut_count + 1
CUTSHAPE .....
cut_count = cut_count + 1
Then at the end you can say ...
for j = 1 to cut_count
CUTEND
next j
This will only work if you want to end the cuts at the end of your script.
Sometimes you need to a particular cut straight after a particular command and then carry on with the script.
I guess in this case you could do a CUTEND and then reduce the count by one and then end the rest at the end of your script.
Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11