I’m attempting to create a simple script to batch process all subtools in a tool and delete those that are below the desired threshold. It’s mostly functional except it doesn’t execute the desired action on every subtool. It successful retains any subtools outside of the threshold, but doesn’t seem to catch all within the threshold on the first run. It has to be ran multiple times in order to catch everything. Anyone have insight on why it might be missing some?
[VarDef, pointCount]
[IButton, “Cleanup”,
[If, [IsEnabled, “Tool:SubTool:SelectUp”], [SubToolSelect, 0]]
[Loop, 999,
[Loop, 999,
[Mesh3DGet,0, , ,pointCount]
[If, (pointCount < 1000), [IPress, “Tool:SubTool:Delete”],]
[If, [IsEnabled, “Tool:SubTool:SelectDown”], [LoopExit]]
[IPress, “Tool:SubTool:SelectDown”]
]
[If, [IsEnabled, “Tool:SubTool:SelectDown”], [LoopExit]]
]
[Note, “Batch Delete Complete”]
,1.0]