Hello InkscapeForum i have question for a program i wrote in python.
I want to Import a "template.svg" with different Groups (with ID) and need to Seperate them in my Program.
1. How do i load the "template.svg" into my program?
2. What are the tools to manipulate the XML-Tree which Inkscape offers?
[Inkscape Extension] Import SVG / Edit XML-Tree
Re: [Inkscape Extension] Import SVG / Edit XML-Tree
I think you might want to look at Jabier's pattern extension. That one will show you how to import a new template, and it also manipulates objects in the template before loading it into Inkscape: https://inkscape.org/en/~jabiertxof/%E2 ... xtension+0
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: [Inkscape Extension] Import SVG / Edit XML-Tree
Thanks i will take a look on that!
Re: [Inkscape Extension] Import SVG / Edit XML-Tree
How can i turn a XPATH into a .ELEMENT?
I got my Object as XPATH but cant Access its Attributes because its XPATH and no direct ElementTree object
I got my Object as XPATH but cant Access its Attributes because its XPATH and no direct ElementTree object
Re: [Inkscape Extension] Import SVG / Edit XML-Tree
I have different Objects, i seperate them via xpath
searchStr = '//svg:g[@attribute-creator="popup1"]'
selectStr = template.xpath(searchStr, namespaces=inkex.NSS)
Works fine, my Object is saved in
selectStr[0]
...now i got
Main Group (popup1)
-Child Group Button1
--Rectangle Rect1
--Text
-Child Group Button2
--Rectangle Rect2
--Text
its everything in selectStr[0] , which seems to be "xpath" !
...i dont want to change the Original File because its the Template to copy from
I use the XML-Name "attribute-creator" for selecting the Groups/Objects like to edit it with .set method
searchStr = '//svg:g[@attribute-creator="popup1"]'
selectStr = template.xpath(searchStr, namespaces=inkex.NSS)
Works fine, my Object is saved in
selectStr[0]
...now i got
Main Group (popup1)
-Child Group Button1
--Rectangle Rect1
--Text
-Child Group Button2
--Rectangle Rect2
--Text
its everything in selectStr[0] , which seems to be "xpath" !
...i dont want to change the Original File because its the Template to copy from
I use the XML-Name "attribute-creator" for selecting the Groups/Objects like to edit it with .set method
Re: [Inkscape Extension] Import SVG / Edit XML-Tree
I can't help with this. But I wanted to point you to this page, with lots of resources. I'm not even sure if what you need is covered here. But it's worth having a look, probably (if you haven't already seen it).
Also for the best help with writing extensions, I would suggest one of the mailing lists. For whatever reason, mailing lists is how the more advanced users and developers prefer to interact. Either the development list or user list will get you the help you need (if you don't get answers here). https://inkscape.org/en/community/mailing-lists/
Also for the best help with writing extensions, I would suggest one of the mailing lists. For whatever reason, mailing lists is how the more advanced users and developers prefer to interact. Either the development list or user list will get you the help you need (if you don't get answers here). https://inkscape.org/en/community/mailing-lists/
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: [Inkscape Extension] Import SVG / Edit XML-Tree
I think Brynn meant to link to https://inkscape.org/en/develop/extensions/ .
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: [Inkscape Extension] Import SVG / Edit XML-Tree
Oh yeah. Sorry, I forgot to paste in the url. Thanks Moini!
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design