dxflib

Every QCAD 3 installation includes some command line tools which allow batch conversion of CAD drawing files.

Under Windows, these utilities are included as batch files (.bat) in the installation directory of QCAD. Under Mac OS X, you can find the utilities as shell scripts inside the application bundle at QCAD.app/Contents/Resources. Under Linux systems, the utilities are also included as shell scripts in the installation directory of QCAD.

dwg2svg

dwg2svg converts a DXF or DWG file into an SVG (Scalable Vector Graphics) file. The output file can be optimized to look exactly the same as the drawing file (default) or to transfer as much of the geometry across as possible (switch -g).

Usage: dwg2svg [OPTION]... <drawing file>

Converts a DWG / DXF file to a SVG file.

-a, -adjust adjust page size to include thickest lineweight -b, -bottom=MB set page margin at bottom to MB -c, -circle=CR export points as circles with radius CR -e, -equalmargins=M set all page margins to M -l, -r, -t and -b are ignored -f, -force Overwrite existing output file -g, -preservegeometry preserve as much of the original geometry as possible default is identical rendering -h, -help display this help -i, -inkscape generate additional information for Inkscape -l, -left=ML set page margin at left to ML -o, -outfile=FILE set output file to FILE default is same path and base name as input file -p, -open open the converted file after conversion -r, -right=MR set page margin at right to MR -s, -scale=SF set scale factor to SF -t, -top=MT set page margin at top to MT -x, -cross=CS export points as crosses with size CS

Points: If neither -c nor -x is given, points are not exported.SVG Units: SVG only supports the following units: mm, cm, in. - Unsupported Metric drawing units are converted to Millimeters. - Unsupported Imperial drawing units are converted to Inches. Use -s to scale and avoid large values.Margins: Margin values have to be specified in the (converted) SVG unit.

dwg2pdf

dwg2pdf converts a DXF or DWG file into a PDF file. The drawing file is expected to contain information about the paper size, orientation and drawing scale and offset.

Usage: ./dwg2pdf.sh [OPTIONS]... <drawing file>

Converts a DWG / DXF file to a PDF file.

-f, -force Overwrite existing output file -h, -help Display this help -o, -outfile=FILE set output file to FILE default is same path and base name as input file

merge

merge is a powerful tool to merge multiple drawing files (DXF,DWG,...) into one. Each drawing can be individually positioned, rotated, scaled and flipped horizontally or vertically. One of the parameters when calling merge is an XML file which defined what drawings are inserted and where, at what angle, etc. The insert tag may be repeated to insert the same drawing multiple times with different parameters.