spakin / SimpInkScr

Simple Inkscape Scripting
https://inkscape.org/~pakin/%E2%98%85simple-inkscape-scripting
GNU General Public License v3.0
330 stars 32 forks source link

Saving Script Output To SVG #50

Closed oomlout closed 2 years ago

oomlout commented 2 years ago

Thanks for such a lovely extension I'm having a great time with it!

I'm using it to generate electronic diagrams and would like to save the generated graphic to an SVG file.

I've been exploring with trying to get the svg structure out using the svg_root global variable but haven't been able to quite crack it.

Is this possible, or planned functionality in the future?

spakin commented 2 years ago

I'm glad to hear you like Simple Inkscape Scripting!

In Inkscape 1.2+ one can automate saving the current image with

inkex.command.write_svg(svg_root, '/home/oomlout/myfile.svg')

Does that answer your question?

oomlout commented 2 years ago

A perfect answer! Thanks!