Hi, i''m coding a new extension (and i'm learning step by step?Now i have this structureextensionsmyextension.inx-- myextension--- myextension.py--- svg---- flower.svg---- elephant.svgin the UI of my extension i have an enum select and i want to insert, in the document, one of this svg files according to my selectionThanks
I seem to remember that lxml can read files directly and parse the DOM...
Ah, here:
https://lxml.de/parsing.html
I'm not sure how to reliably find the file on all operating systems, though, you'd need to try that out. Maybe also the inkex api provides a way to get the path to the script now...?
Check here to find out: https://inkscape.gitlab.io/extensions/documentation/
(this is the API for the upcoming 1.0)
Thanks Maren
Hi, i''m coding a new extension (and i'm learning step by step?
Now i have this structure
extensions
myextension.inx
-- myextension
--- myextension.py
--- svg
---- flower.svg
---- elephant.svg
in the UI of my extension i have an enum select and i want to insert, in the document, one of this svg files according to my selection
Thanks
I seem to remember that lxml can read files directly and parse the DOM...
Ah, here:
https://lxml.de/parsing.html
I'm not sure how to reliably find the file on all operating systems, though, you'd need to try that out. Maybe also the inkex api provides a way to get the path to the script now...?
Check here to find out: https://inkscape.gitlab.io/extensions/documentation/
(this is the API for the upcoming 1.0)
Thanks Maren