Inkscape Python Union

Post questions on how to use or achieve an effect in Inkscape.
Tieum
Posts: 1
Joined: Tue Dec 22, 2015 8:41 pm

Inkscape Python Union

Postby Tieum » Tue Dec 22, 2015 9:07 pm

Hello,

I have a file where I have some groups with paths underneath (~20 groups each containing 2 to 40 path) that I need to union to make one single path.

I am looking to do this through a Python plugin but could not figure out how to union multiple path through python.

How can I achieve this?

Thanks,

Tieum

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

Re: Inkscape Python Union

Postby Moini » Wed Dec 23, 2015 3:42 am

There's a multi-ungroup extension here: https://github.com/cw/inkscape-ungroup-deep

(but instead of downloading, installing, restarting, then finding and using the extension to ungroup, it might be quicker to just select the groups (all of them), hit Ctrl+U or Ctrl+Shift+G to ungroup repeatedly until the status line no longer says that there are groups in the selection. Then just keep everything selected and hit Path -> Union.

In case not everything is a path, do 'Path -> Object to Path' before the union.)
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)

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Inkscape Python Union

Postby brynn » Wed Dec 23, 2015 6:40 am

I almost posted a nearly identical reply earlier (except I was thinking Union or Combine, after entering the group). But after re-reading a few times, I got the impression Tieum wants to write a new extension.

It was because of "....how to union multiple path through python." that made me think that. But I'm not sure if Python is responsible for Union and Combine. I know that most extensions use python. But I don't know how it works on the canvas (Path menu > Union or Combine).

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

Re: Inkscape Python Union

Postby Moini » Wed Dec 23, 2015 7:17 am

The python extensions can either 'talk' to Inkscape and ask it to do something using the built-in Inkscape routines, or they can make the changes in the document themselves. So, both are possible ;)

Not sure why this would need an extension, if it's only a single file that needs editing, that's why I started with the easy part ;)
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 “Help with using Inkscape”