Hi! I have the following code that is supposed to remove the selected nodes and keep shapes:
for item in Layer.selection:
if not item.parent:
continue
item.parent.removeNodeCheckKeepShape_normalizeHandles_(item, True)
If you run it with 1 circle selected, it works as expected, but select 2 circles and it raises this error:
Traceback (most recent call last):
File "<macro panel>", line 1
File "_convenience.py", line 152, in <lambda>
("__next__", lambda self: container_unwrap(self.nextObject(), StopIteration)),
^^^^^^^^^^^^^^^^^
IndexError: NSRangeException - *** -[NSArray getObjects:range:]: range {16, 8} extends beyond bounds [0 .. 6]
I get that the iteration breaks somewhere, but can’t figure out what to check to avoid it, any hints please?