Skip to content

Importing

Christopher edited this page Apr 6, 2017 · 2 revisions

Localplot can now import SVG and DXF files by farming out the conversion to HPGL and then importing the resulting HPGL file.

SVG

Inkscape has a python SVG-to-HPGL converter that can be run as a command.

Example usage:

python2.7 /usr/share/inkscape/extensions/hpgl_output.py drawing_inkscape.svg > drawing_inkscape.hpgl

DXF

DXF files are a little more tricky. Again, Inkscape has a bundled DXF-to-SVG converter, but the SVG it spits out is rejected by the SVG-to-HPGL tool... Nice. So we convert to SVG, then invoke inkscape directly to reparse the SVG and save it again, and then finally run the standard SVG import.

Example usage:

python2.7 /usr/share/inkscape/extensions/dxf_input.py drawing.dxf > drawing.svg

inkscape -z -l drawing.svg drawing.svg

python2.7 /usr/share/inkscape/extensions/hpgl_output.py drawing.svg > drawing.hpgl

http://wiki.inkscape.org/wiki/index.php/Script_extensions

http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/verbs.cpp

http://stackoverflow.com/questions/36719846/convert-dxf-to-svg-in-inkscape-cli-while-keeping-layers

Clone this wiki locally