Inkscape.org
Creating New Extensions Copy an element, including defs
  1. #1
    Nihilist Nihilist @Nihilist

    If I have two Inkscape documents open, it is possible for me to copy an element from one, and paste it in the other. When I do this, the "dependencies" of that element (being, any elements stored in defs which this element relies on) are also copied automatically into the defs of the target document. This is a really helpful feature.

    Now, I am making an extension where a user will be able to select a file, and give an element ID, and that element will be copied into the current document, essentially a "copy paste". However doing this manually in code means that the dependencies of the element (in defs) won't be carried over.

    So, my question is, is the "copy paste" feature of Inkscape, which automatically moves an element (including its dependencies) into a new document, available somewhere in inkex, accessible to extensions written in Python? Or do I need to re-implement this behavior myself?