I couldn't find any function in inkex package to do path operations like difference (Ctrl + -), intersection (Ctrl + *) or exclusion (Ctrl + ^). anyone can help?
These operations cannot be found in the inkex package, but you could take a look at the inx-pathops extension. In that extension command line operations inkex.command is used to perform the boolean operations.
Thank you Ellen. I found below function in pathops source which creates a list of actions and then runs it by calling inkscape(svgfile, "--with-gui", actions=actions)
from inkex.command import inkscape
def run_pathops(self, svgfile, top_path, id_list, ink_verb, dry_run=False):
"""Run path ops with top_path on a list of other object ids."""
# build list with command line arguments
actions_list = []
for node_id in id_list:
actions_list.append("select-by-id:" + top_path)
actions_list.append("EditDuplicate")
actions_list.append("select-by-id:" + node_id)
actions_list.append(ink_verb)
actions_list.append("EditDeselect")
actions_list.append("FileSave")
actions_list.append("FileQuit")
actions = ";".join(actions_list)
# process command list
if dry_run:
inkex.utils.debug(" ".join(["inkscape", "--with-gui", "--actions=" + "\"" + actions +
"\"", svgfile]))
else:
inkscape(svgfile, "--with-gui", actions=actions)
Hi,
I couldn't find any function in inkex package to do path operations like difference (Ctrl + -), intersection (Ctrl + *) or exclusion (Ctrl + ^). anyone can help?
These operations cannot be found in the inkex package, but you could take a look at the inx-pathops extension. In that extension command line operations inkex.command is used to perform the boolean operations.
Thank you Ellen. I found below function in pathops source which creates a list of actions and then runs it by calling
inkscape(svgfile, "--with-gui", actions=actions)
are you aware of any documentation where I can find more about this inkscape api. I couldn't find much in https://inkscape.gitlab.io/extensions/documentation/inkex.command.html
I have "learning to run inkscape from command lines" on my todo list, but know near to nothing per se. Maybe this command line builder from inklinea could help you: https://inkscape.org/forums/other/inkscape-command-line-builder-work-in-progress/#c23571.
Or read more about command line here: https://wiki.inkscape.org/wiki/index.php/Using_the_Command_Line
Thanks a lot.