Linea di comando degli strumenti QCAD

Ogni installazione QCAD Professional include alcuni strumenti sulla linea di comando che permettono la conversione batch (di gruppo) dei file di disegno CAD.

Contenuti

 

Note sulla Piattaforma

Windows

Con Windows, queste utilità sono incluse come file batch (.bat) nell’installazione della directory di QCAD.

macOS

Con macOS, troverai le utilità negli script shell nell’applicazione in bundle qui sotto:

QCAD-Pro.app/Contents/Resources

Linux

Anche con i sistemi Linux, le utilità sono incluse come script shell nell’installazione della directory di QCAD.

dwg2bmp

(also dwg2png, dwg2jpeg, dwg2tiff, dxf2png, dxf2jpeg, dxf2tiff, ...)

dwg2bmp converte un file DXF or DWG in un file bitmap. I formati output supportati sono: BMP, ICO, JPEG, PNG, PPM, TIFF, XBM, XPM.

Il numero massimo di byte per i dati immagine raw è di 2'147'483'647 byte. Con quattro byte per pixel (ARGB), la dimensione massima per il file di output è di 536'870'911 pixels, o ad esempio 23'170x23'170 pixel.

Usage: ./dwg2bmp [OPTIONS]... <drawing file>

Converts a drawing file (DWG, DXF, ...) to a bitmap file (BMP, PNG, ...).

  -a, -antialiasing       Enable antialiasing
  -b, -background=C       Set the background color as color name
                          e.g. 'white' or '#ccdd00'.
      -block=BLOCK_NAME   Name of block (or layout) to output
                          (defaults to *Model_Space)
  -c, -color-correction   Enable color correction to prevent white on white
                          or black on black painting
  -d, -recompute-dim      Recompute dimension blocks if empty
                          (dimensions rendered with best compatibility)
  -f, -force              Overwrite existing output file
  -fs, -font-substitution FONT1 FONT2
                          Substitute FONT1 with FONT2
  -h, -help               Display this help
      -no-weight-margin   Don't add additional margin to compensate for
                          lineweight
  -k, -grayscale          Grayscale
      -layer=LAYER_NAMES  Comma-separated list of layer(s) to export
                          List may include regular expressions
  -l, -list               List supported formats
  -m, -margin=M           Set auto zoom margin to M (in pixels)
  -n, -monochrome         Monochrome (black / white)
  -o, -outfile=FILE       Set output file to FILE
                          Default is same path and base name as input file
  -q, -quality=Q          Set the image quality / compression
                          (0=best compression..100=best quality)
  -r, -resolution=R       Set rendering resolution to R
                          (in pixels/drawing unit)
                          This overrides the width/height parameters.
  -w, -window=X,Y,W,H     Zoom to given window
  -x, -width=W            Set bitmap width to W (in pixels)
  -y, -height=H           Set bitmap height to H (in pixels)
                          The maximum size for width*height is 536870911 pixels
      -zoom-all           Auto zoom to maximum extends of all layers
  -p, -origin             Draw zero point (origin)

dwg2svg

(also dxf2svg)

dwg2svg converte un file DXF or DWG  in un file SVG (Grafica Vettoriale Scalabile). Il file di output può essere ottimizzato per sembrare esattamente come il file di disegno (default) o per trasferire più geometria possibile (switch -g).

Usage: ./dwg2svg [OPTIONS]... <drawing file>

Converts a drawing file (DWG, DXF, ...) file to an SVG file.

  -a, -adjust             Adjust page size to include thickest line weight
  -b, -bottom=MB          Set page margin at bottom to MB
      -block=BLOCK_NAME   Name of block (or layout) to output
                          (defaults to *Model_Space)
  -c, -circle=CR          Export points as circles with radius CR
  -d, -recompute-dim      Recompute dimension blocks if empty
                          (dimensions rendered with best compatibility)
      -decimals=D         Decimal places for float values (defaults to 4)
  -e, -equal-margins=M    Set all page margins to M
                          -l, -r, -t and -b are ignored
      -embed-images       Embed images (bitmaps)
  -f, -force              Overwrite existing output file
  -fs, -font-substitution FONT1 FONT2
                          Substitute FONT1 with FONT2
  -g, -preserve-geometry  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
      -layer=LAYER_NAMES  Comma-separated list of layer(s) to export
                          List may include regular expressions
      -layer-attribute    Export layer attributes into QCAD SVG namespace
  -n, -no-comments        Suppress comments for DXF entities
  -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
  -u, -unit=[in|m|mm]     Assume input data to be in given unit
                          Default is the drawing unit
                          Mainly useful for drawings with unit 'None'
  -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
  -w, -min-lineweight=LW  Set minimum line weight to LW drawing units
                          Defaults to 0.001 since 0 in SVG means invisible
  -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 CAD 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.

Examples:
Adjust page, set all margins to 1.5, export points as circles with radius 0.5:
./dwg2svg -a -e 1.5 -c 0.5 file.dwg

Set scale factor to '1:200':
./dwg2svg -s 1:200 file.dwg

dwg2pdf

(also dxf2pdf)

dwg2pdf converte un file DXF or DWG in un file PDF. Il file di disegno dovrebbe contenere informazioni sulla dimensione della carta, sull’orientazione e scala di disegno e sull’offset.

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

Converts a DWG / DXF file to a PDF file.
  -a, -auto-fit           Auto fit and center drawing to paper
      -block=BLOCK_NAME   Comma-separated list of block(s) or
                          layout(s) to export
List may include regular expressions -c, -center Auto center drawing on paper -d, -recompute-dim Recompute dimension blocks if empty (dimensions rendered with best compatibility) -e, -papers List all supported paper size names -point-size=SIZE Set size of points in mm -f, -force Overwrite existing output file -fs, -font-substitution FONT1 FONT2 Substitute FONT1 with FONT2 -h, -help Display this help -k, -grayscale Grayscale -l, -landscape Landscape (default is portrait) -layer=LAYER_NAMES Comma-separated list of layer(s) to export List may include regular expressions -list-printers List all available printers -m, -margin=M Set paper margins to M -n, -monochrome Monochrome (black / white) -o, -outfile=FILE Set output file to FILE default is same path and base name as input file -offset=X,Y Set offset to X,Y in drawing units ('3,4', '7/2,1/4', '0.5,-1.5', ...) -p, -paper=WxH Set paper size to W x H in mm or to named paper size ('A4', 'Letter', ...) -printer=PRINTER Print directly to PRINTER or default printer if no printer given -s, -scale=SCALE Set drawing scale to given scale ('1', '2', '0.5', '1:1', '1:5', '5:1', ...) -w, -minlineweight=LW Set minimum line weight to LW drawing units

dwg2maptiles

(also dxf2maptiles)

dwg2maptiles crea automaticamente set di riquadri da usare in mappe online . La directory/struttura file generata segue lo standard di (z/x/y.png). Il numero dei livelli di zoom (z) è adattabile. I suddetti riquadri della mappa possono essere usati per creare mappe interattive per il web, usando leaflet.js ad esempio. Clicca qui per visualizzare esempi di mappe create con dwg2maptiles e leaflet.js.

Usage: ./dwg2maptiles [OPTIONS]... <drawing file>

Converts a drawing file (DWG, DXF, ...) to a set of
bitmap files (PNG, JPEG, ...) for use with online maps, e.g. leaflet.js.

  -a, -antialiasing       Enable antialiasing
  -b, -background=C       Set the background color as color name
                          e.g. 'white', '#ccdd00' or 'transparent'
      -block=BLOCK_NAME   Name of block (or layout) to output
                          (defaults to *Model_Space)
  -c, -colorcorrection    Enable color correction to prevent white on white
                          or black on black painting
      -center=X,Y         Set center of first tile to X,Y in drawing units
  -d, -recompute-dim      Recompute dimension blocks if empty
                          (dimensions rendered with best compatibility)
  -e, -tile=ROW,COL       Generate only tile at ROW,COL
  -f, -force              Overwrite existing output file
  -fs, -font-substitution FONT1 FONT2
                          Substitute FONT1 with FONT2
  -h, -help               Display this help
  -k, -grayscale          Grayscale
      -layer=LAYER_NAMES  Comma-separated list of layer(s) to export
                          List may include regular expressions
  -l, -list               List supported formats
      -tms                Y=0 is at the bottom (typically used for TMS,
                          default is Y=0 at the top for WMS)
  -n, -monochrome         Monochrome (black / white)
  -o, -outdir=DIR         Set output dir to DIR
                          default is same path and base name as input file
  -q, -quality=Q          Set the image quality / compression
                          (0=best compression..100=best quality)
  -r, -resolution=R       Set rendering resolution of first tile to R
                          (in pixels/drawing unit)
                          This overrides the width/height parameters
  -s, -subsection=N,M     Generate subsection N of M
                          Examples:
                          1,4: generate first of four subsections
                          4,4: generate fourth of four subsections
                          7,8: generate seventh of eight subsections
  -t, -format             File format (png, jpeg, gif)
  -x, -width=W            Set bitmap width to W (in pixels)
  -y, -height=H           Set bitmap height to H (in pixels)
  -p, -origin             Draw zero point (origin)
  -z, -zoomlevels         Number or range of zoom levels, defaults to 0-6
                          Examples:
                              5:   zoom levels 0,1,2,3,4,5
                            3-5: zoom levels 3,4,5
                          1,3,5: zoom levels 1,3,5
                            3-3: zoom level 3 only

dwg2dwg

(also dwg2dxf, dxf2dwg)

dwg2dwg legge e scrive file DXF or DWG ed eroga file DXF o DWG. Diverse impostazioni come la versione del formato del file possono essere cambiate.

Usage: ./dwg2dwg [OPTIONS]... <drawing file>

Converts a drawing file (DWG, DXF, ...) file from one version to another.

  -f, -force              Overwrite existing output file
  -h, -help               Display this help
  -l, -list               List supported releases
  -n, -setdimfont=FONT    Set the dimension font to the given font
  -o, -outfile=FILE       Set output file to FILE
                          Default is same path and base name as input file
  -r, -release=RELEASE    Set output DXF/DWG release to RELEASE
  -s, -set=VARIABLE:VALUE Set the given known variable to the given value
                          For example -s DIMASZ:2.5
                          DXF header variables that can be changed are
                          (among others):
                          DIMADEC:  Angular dimension label precision (0-8)
                          DIMASZ:   Dimension arrow size
                          DIMAUNIT: Angular dimension label format
                                    0: decimal degrees
                                    1: deg/min/sec
                                    2: gradians
                                    3: radians
                                    4: surveyors
                          DIMAZIN:  Trailing zeroes for angular dimensions
                                    (0: on, 2: off)
                          DIMDEC:   Set linear dimension label precision (0-8)
                          DIMDLI:   Dimension line increment
                          DIMEXE:   Extension line extension
                          DIMEXO:   Extension line offset
                          DIMGAP:   Dimension line gap
                          DIMLUNIT: Set linear dimension label format
                                    1: scientific
                                    2: decimal
                                    3: engineering
                                    4: architectural
                                    5: fractional
                          DIMTSZ:   Dimension arch tick size (0 for arrow)
                          DIMTXT:   Dimension text height
                          DIMZIN:   Trailing zeroes (0: on, 8: off)
  -t, -substitute=FONT1:FONT2
                          Substitute FONT1 with FONT2 in all texts

dwghatch

(also dxfhatch)

dwghatch crea un’entità di  tratteggio di riempimento solido usando percorsi racchiusi all’interno del file di disegno dato come contorno. I percorsi delimitati contenuti in altri percorsi delimitati sono considerati delle isole.

Usage: ./dwghatch [OPTIONS]... <data file>

Fill all fillable (closed) boundaries of the given drawing
file (DXF, DWG) with a solid fill hatch.

 -f, -force               Overwrite existing output file
-h, -help Display this help
-o FILE, -output=FILE Set CAD output file to FILE

merge

merge è un potente strumento per mettere insieme multipli file di disegno (DXF, DWG,...). Ogni disegno può essere individualmente posizionato, rotato, scalato e capovolto sia orizzontalmente che verticalmente. Uno dei parametri usati quando si richiede “merge” è un file XML che definisce quali disegni sono inseriti e dove, a quale angolo ecc.

Il tag "insert" (inserire) potrebbe essere ripetuto per inserire lo stesso disegno diverse volte con differenti parametri..

Usage: ./merge [OPTIONS]... <XML config file>

Merges multiple drawing files (DWG, DXF, ...) into one.

  -f, -force              Overwrite existing output file
  -h, -help               Display this help
  -t TYPE, -type=TYPE     Set file type to TYPE 
                          (e.g. R12...R27 or 2000...2013)
  -o FILE, -outfile=FILE  Set output file to FILE
                          default is same path and base name as input file

Mac OS X specific options:

  -no-dock-icon           Don't show icon in dock. This should only be used
                          in combination with -no-gui.

XML format:
<?xml version="1.0" encoding="UTF-8"?>
<merge xmlns="http://qcad.org/merge/elements/1.0/" unit="Millimeter">
    <item src= "file1.dxf">
        <insert x="10" y="0" angle="30" flipx="false" flipy="false" />
    </item>
</merge>