DXF Batch conversion support?

Post questions on how to use or achieve an effect in Inkscape.
SamFinnigan
Posts: 2
Joined: Fri Mar 09, 2012 8:31 pm

DXF Batch conversion support?

Postby SamFinnigan » Fri Mar 09, 2012 8:58 pm

Hi,
I'm working on a mapping project for which I have a large number of blueprints of a building- unfortunately they are all AutoCAD DXFs.

I've been able to successfully open these (individually) in Inkscape's GUI, but for the purpose of rendering them I'd like to convert them to SVGs. There are about a hundred or so of them.

I can easily hack together a script to loop through the files, but I've come unstuck at the point where inkscape actually reads in the file:

Code: Select all

sam@laptop:~$ inkscape -f infile.dxf --export-plain-svg=outfile.svg
infile.dxf:1: parser error : Start tag expected, '<' not found
  0
  ^

** (inkscape:15178): WARNING **: Specified document infile.dxf cannot be opened (does not exist or not a valid SVG file)


I get a small GUI window (same as when I open a DXF via the GUI) asking about scaling the image, and hit "OK". Then Inkscape goes ahead with assuming it's an SVG and looks for the opening < tag. So I'd like to know if there's a way I can tell Inkscape, via the command line, what file type to expect, as I couldn't really see anything along those lines in the manpages. Or, if Inkscape just doesn't support command line DXF parsing, what would you recommend as an alternative?

Thanks,
Sam.

[EDIT]
Here's the DXF import dialog that comes up:
Screenshot-DXF Input.png
Screenshot of DXF import window
Screenshot-DXF Input.png (24.61 KiB) Viewed 1836 times

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: DXF Batch conversion support?

Postby ~suv » Sat Mar 10, 2012 3:02 am

On the command line (as well as in the script), reference the DXF file with its full (absolute) path name (to work around bug #695120 in Inkscape 0.48 and current trunk).

SamFinnigan
Posts: 2
Joined: Fri Mar 09, 2012 8:31 pm

Re: DXF Batch conversion support?

Postby SamFinnigan » Fri Mar 16, 2012 8:11 pm

~suv wrote:On the command line (as well as in the script), reference the DXF file with its full (absolute) path name (to work around bug #695120 in Inkscape 0.48 and current trunk).


Thanks, this worked for me:

Code: Select all

sam@laptop:~$ inkscape -f `pwd`/Test.dxf --export-plain-svg=outfile.svg
sam@laptop:~$ ls -l | grep outfile.svg
-rw-r--r-- 1 sam sam     1201 2012-03-16 10:06 outfile.svg


Return to “Help with using Inkscape”