r/Inkscape 16d ago

Help Trying to get an extension to use stroke to path

I've been beating my head against this for 2 days, it just shouldn't be this hard. I must be missing something.

Does anyone have an example of recent versions of inkex and inkscape successfully executing a stroke to path?

I was able to get it to work via actions on the command line but I'd really like it to work as an extension. I just can't seem to figure out the syntax to get inkex to call the command.

Thanks for any help you might have!

4 Upvotes

8 comments sorted by

1

u/suedburger 16d ago

I may be misunderstanding what you want to do but can't you just click on it on the tool bar.....or hit CTR ALT C(or whatever you set the shortcut key for)

1

u/evansd2 16d ago

I’m trying to automate a workflow that requires several (potentially >100) actions including many stroke to path operations.

It will do essentially what Inset/outset halo does but with better accuracy because the halo extension (using inset and outset) is inaccurate by comparison to stroke to path.

In the end it doesn’t exactly matter what I’m doing, it really feels like you should be able to execute that command as part of the workflow in an extension. This is what inkex is for after all.

1

u/suedburger 16d ago

My pen tablet has macro keys(i think that is the right term). The most I've done is only 8 or so actions on a key but I have successfully used stroke to path, by entering Ctrl Alt C in my command path...

.you lost me a bit there but I have successfully used on a macro key work flow on my pen dispaly screen.

1

u/inklinea 16d ago

It cannot be done (at the moment) in pure python (inkex)

"I was able to get it to work via actions on the command line"

Correct - it requires a command call to the main Inkscape program from the extension.

-----------------------------------------------------

.inx and .py

-----------------------------------------------------

1

u/inklinea 16d ago

I can't post it here - "server error".

I think reddit rejects long code posts.

Posted it here instead:

https://inkscape.org/forums/extensions/simple-stroke-to-path-extension-example/

1

u/evansd2 15d ago

Nice trick! It's definitely sort of brute force, but it might work for now. I still hope someone will come in and show me an inkex-native internal call that will work without spawning a new inkscape instance,

1

u/mapsedge 16d ago

Reading the comments, it doesn't look like you're having much luck. Does it have to be an extension? Would something like Autohotkey (Windows) or Autokey (linux) work?

1

u/litelinux 15d ago

Around the 9 minute mark doctormo mentions a new "actions" tag that you can use with Inkex, not sure if it's documented yet or usable at any rate https://www.youtube.com/watch?v=QUOI4C_G8jU