Hi everyone!
Does anyone know if it is somehow possible to change the selection or the active layer from within an Inkscape Python extension?
I couldn't find anything like that in the extensions shipped with Inkscape. Also, the Inkscape multipage extension uses a real weird workaround for page navigation: instead of using layers for pages, all pages are stored "offline" in an invisible element and are swapped into a single layer for viewing or editing.
This probably means that it's not possible, but I just thought it'd be safer to ask.
Many thanks for an answer!
Change layer or selection from within extension
Re: Change layer or selection from within extension
Never mind, I think I found the solution myself.
I just saw that you could change the current-layer attribute of the namedview element. It's not read by Inkscape after running an extension right now, but it says here that this is going to be fixed in the next release.
Alternatively, you can swap the id of the current layer into the layer that you want to select, as long as that id isn't referenced anywhere.
I just saw that you could change the current-layer attribute of the namedview element. It's not read by Inkscape after running an extension right now, but it says here that this is going to be fixed in the next release.
Alternatively, you can swap the id of the current layer into the layer that you want to select, as long as that id isn't referenced anywhere.