Inkscape.org
Beyond the Basics Export DXF Via Command Line
  1. #1
    tmcginn tmcginn @tmcginn

    I have been experimenting with using the command line to automate the creation of DXF files from SVG files. I am able to successfully create the DXF files, but when I import the DXF files into Solidworks there are often open contours which cause problems. If I use the GUI to save my SVG as a DXF file there are two options "AutoCAD DXF R12" and "AutoCAD DXF R14". I have found that if I use "AutoCAD DXF R12" to create my DXF file the line art will have open contours when I import it into Solidworks, but if I use "AutoCAD DXF R14" to create my DXF file the line art imports perfectly without any issues. This leads me to believe that the command line is exporting the DXF file via "AutoCAD DXF R12". Is there a way to export the DXF file using the command line functions and "AutoCAD DXF R14"?

  2. #2
    Aero Aero @Aero◻️

    This exported R14 here in 1.2-beta.

    inkscape --export-type=dxf --export-extension=org.ekips.output.dxf_outlines drawing.svg

  3. #3
    tmcginn tmcginn @tmcginn

    Where did you find these commands? If I use --action-list in the command line, neither the action --export-extension or the extension org.ekips.output.dxf_outlines drawing.svg are listed.

    This did work though.

  4. #4
    Aero Aero @Aero◻️

    --export-extension=EXTENSION-ID
    Link is in menu Help -> Command Line Options.

    The EXTENSION-ID from dxf_outlines.inx in the extensions folder.

  5. #5
    tmcginn tmcginn @tmcginn

    Thank you for the help, much appreciated. I didn't realize there were commands outside of the actions in the actions list.

    For anyone that is trying to do something similar, here is my final command line to ungroup a bunch of text objects and create a R14 DXF file.

    inkscape --actions="select-all:all;selection-ungroup;selection-ungroup;selection-ungroup;object-to-path;select-all:all;selection-ungroup" --export-type=dxf --export-filename="C:\ExportFileLocation\NewExport.dxf" --export-extension=org.ekips.output.dxf_outlines "C:\OriginalFileLocation\OriginalSVG.svg"