Can I do that with scripting?

General discussions about Inkscape.
mels33
Posts: 2
Joined: Tue Jul 11, 2017 5:20 am

Can I do that with scripting?

Postby mels33 » Tue Jul 11, 2017 5:31 am

I manually do a serie of action in Inkscape and I want to know if I can automate them.

Here's an exemple :

I draw my design in layer 1.
Now I want to automatically :

1 - Copy my original design in "layer 2"
2 - Make all vector 1 px thick
3 - Remove all the color of my design (I need only the vector, in black, 1 px thick)
4 - Create an offset of 10 px on all closed vector
5 - Export this new vector in EPS

How can I do that with scripting?

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Can I do that with scripting?

Postby Moini » Tue Jul 11, 2017 7:05 am

Yes, this is possible.

You'll either need to write an extension for this, to be run from inside Inkscape, or you need to write a command line script.

More info is available here:
https://inkscape.org/doc/inkscape-man.html
http://tavmjong.free.fr/INKSCAPE/MANUAL ... dLine.html
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)

mels33
Posts: 2
Joined: Tue Jul 11, 2017 5:20 am

Re: Can I do that with scripting?

Postby mels33 » Thu Jul 13, 2017 12:00 am

Great!

I already do some light PHP programming. So I think I can manage some Python !
Do you have a prefered editor? I'm with Notepad++ for my PHP

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Can I do that with scripting?

Postby Moini » Thu Jul 13, 2017 2:31 am

I'm on Linux Mint. I mostly use Kate, gedit and atom (with a lot of customizations, took long to get it all work the way I want, but it's nice now).
Enjoy the Python :) (I came from PHP, too, when I started with Python. It was quite a difference in how variables are handled... Now I can barely remember PHP ;-) )
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)


Return to “General Discussions”