I have made an extension that does a bunch of stuff with symbols and their clones, but the final action i'd like to do is ungroup but i'm stumped.
I'm happy finding the object element(s) and children, but am unable to workout how to remove them from the group/container in a single operation. Have tried monkeying about ElementTree copy/_setroot as well as with deepcopy and other such techniques but can't get them to work. e.g.
So basically, does anyone know if there is a classmethod that would do this simply, like AddBeforeParent in XML?
I'm surprised no one has asked this question before, which makes me feel like there is something obvious i'm missing. Else I'll have to dig into making a recursive, element by element copy method.
I have made an extension that does a bunch of stuff with symbols and their clones, but the final action i'd like to do is ungroup but i'm stumped.
I'm happy finding the object element(s) and children, but am unable to workout how to remove them from the group/container in a single operation. Have tried monkeying about ElementTree copy/_setroot as well as with deepcopy and other such techniques but can't get them to work. e.g.
So basically, does anyone know if there is a classmethod that would do this simply, like AddBeforeParent in XML?
I'm surprised no one has asked this question before, which makes me feel like there is something obvious i'm missing. Else I'll have to dig into making a recursive, element by element copy method.
Yes.
Nodes can only be in 1 place at once.
inkex uses etree.
addnext() addprevious()
Perhaps this:
If we have objects inside a group
for child in my_group.getchildren():
my_group.addnext(child)
and finally.
my_group.delete()
inklinea aren't you a star as well as appearing to be the main source of helpful advice on this forum, thank you.
Thank you for that will give it a go!