How to automate some commands

Discussion about writing code for Inkscape.
scott216
Posts: 18
Joined: Tue Aug 14, 2012 5:22 am

How to automate some commands

Postby scott216 » Fri Sep 20, 2013 10:35 am

I export svg files from sketchup that are eventually used by my laser cutter. Before I cut on the laser cutter I take the Sketchup generated SVG file, open it in inkscape and do the following:

Select an object and ungroup it
Then I combine the same object with ctrl+k
Then with the :tool_node: tool I select the object, then Join nodes (shift+J)

I'd like to be able to click on the object, then click a custom icon or a custom shortcut key to do the rest. Is this something that can be done relatively easy? If so, how would I get started? Even better would be for Inkscape to loop through all the objects and perform these commands on each one.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: How to automate some commands

Postby Lazur » Fri Sep 20, 2013 11:57 pm

I was wondering if you could avoid the problem as writing into the codes/creating an extension that works alike is a way more advanced thing.

So the idea is, to use the render 3D polyhedrons extension.
With that you can import .obj files if you put it under inkscape's share/extensions/poly3Dobjects folder,
and type in the extension's menu the name of the obj.
That way the edges around the faces won't get split apart to separate paths that you would need to join,
and there would be no double nodes to be removed.

Another thing that came to my mind is a bit theoretical:
you can import svg-s to blender, and use them for modelling if necessary.
And, there was a 2009 addon to render to svg-s, so with those working you could use svg-s all the way.
I couldn't get it to work yet though.

scott216
Posts: 18
Joined: Tue Aug 14, 2012 5:22 am

Re: How to automate some commands

Postby scott216 » Sat Sep 21, 2013 1:37 am

Thanks. I'll look into that


Return to “Programming”