According to the documentation, invoking remove() on a shape will remove it from the displayed shapes. However, the following script does not delete any shapes:
for c in all_shapes():
c.remove
From another post in this forum, I found a script that does work:
for c in svg_root.iter():
if isinstance(c, inkex.ShapeElement) and not isinstance(c, inkex.Layer):
c.delete()
It looks like remove removes only shapes that were created using one of the Simple Inkscape Scripting shape commands. I'll update the code shortly to make remove work on any object returned by all_shapes.
According to the documentation, invoking remove() on a shape will remove it from the displayed shapes. However, the following script does not delete any shapes:
for c in all_shapes(): c.remove
From another post in this forum, I found a script that does work:
for c in svg_root.iter(): if isinstance(c, inkex.ShapeElement) and not isinstance(c, inkex.Layer): c.delete()
Why does the first script not work?