Request a Personalized Demo

Learn how to accurately convert your designs with Scan2CAD

  • This field is for validation purposes and should be left unchanged.
  • Join thousands of happy customers worldwide

Vector loading and saving commands

 

The following vector scaling, saving, loading and rasterizing commands are available for use in a Command File.

 

ScaleSettings

ScaleX X Scale value

To create a DXF file at a scale of 1:1 you will need to set this value to:

1 if the scale of the original paper drawing that was scanned in was 1:1.

50 if it was 1:50.

12 if it was 1″ = 1′.

96 if it was 1/8″ = 1′.

etc.

ScaleY Y Scale value

To create a DXF file at a scale of 1:1 you will need to set this value to:

1 if the scale of the original paper drawing that was scanned in was 1:1.

50 if it was 1:50.

12 if it was 1″ = 1′.

96 if it was 1/8″ = 1′.

etc.

DPI Raster resolution in DPI. If set to -1 the dpi will be read from the raster image header. Do not set to -1 unless you know that your raster images contain this information.

To tell whether dpi information is stored in your raster images load a raster image into Scan2CAD and go to File Menu > Raster > Statistics. If the DPI box in File Menu > Raster > Statistics contains a value of 0 the image does not contain dpi information.

ExportUnits The units the CAD program uses:

1 = pixels

2 = inches

3 = feet

4 = yards

5 = miles

6 = millimetres

7 = centimetres

8 = metres

9 = kilometres

10 = geo

11 = hpgl plot units

4 arguments.

Scales the currently loaded vector image – normally used before saving a vector image. See Scale a vector file.

ScaleSettings will affect every subsequently saved vector image unless you reset it by loading a raster image or by setting ScaleX, ScaleY and ExportUnits to 1.

Example code:

SCALESETTINGS

50

50

200

2

 

DXFVersion

DXFVersion 1 or 2

One argument.

Set DXFVersion to 1 to save DXF files in DXF pre R14 format or to 2 to save DXF files in DXF R14 or later format.

The following example code will save the currently loaded vector image as a DXF pre R14 format file called floorplan1.dxf:

DXFVERSION

1

SAVEASVECTOR

c:\users\username\documents\scan2cadv8\samples\floorplan1.dxf

 

DWGVersion

DWGVersion 3 to 7

One argument.

Set DWGVersion to a value between 3 and 7 to save DWG files in the required format.

 3 = R2000~2002

 4 = R2004~2006

 5 = R2007~2010

 6 = R2010~2012

 7 = R2013~2014

 

The following example code will save the currently loaded vector image as a DWG R2010~2012 format file called        floorplan1.dwg:

DWGVERSION

6

SAVEASVECTOR

c:\users\username\documents\scan2cadv8\samples\floorplan1.dwg

 

DXFExportSettings (retained for earlier releases compatibility)

DXFDWGExportSettings

DXFVersion Default DXF File Version (1=DXF Pre Release R14 , 2=DXF Release R14 or later, 3 to 7= DWG Releases)
AutoCADBlackWhiteReversal CAD Color 0->Color 7 (1=ON, 0=OFF)
Bezier2Splines Bezier -> Splines (1=ON, 0=OFF – If DXFVersion=1 then always set to OFF)
Bezier2Arcs Bezier -> Arcs (1=ON, 0=OFF)
Bezier2Polylines Bezier -> Polylines (1=ON, 0=OFF)
PolylineSegments Segments (value between 4 and 200)
IncludeVectorLineWidth Include Line Widths (1=ON, 0=OFF)
SaveAllVectorsByTrueColour Vectors -> True Color (1=ON, 0=OFF – If DXFVersion=1 then always set to OFF)
SaveVectorsByTypeLayer Layers by color or by type (1=Vectors -> Type, 0=Vectors -> Color. If DXFVersion=2 and SaveAllVectorsByTrueColour=ON, then SaveAllVectorsByTrueColour will take priority)
AttachRasterToDXF Attach Raster Image (1=ON, 0=OFF – If DXFVersion=1 then always set to OFF)
RasterCadColourIndex CAD Color Index (value between 0 and 255)
DefaultFontOnlyToDXF Font (1=ON, 0=OFF – If DXFVersion=1 then always set to ON)

12 arguments.

Sets DXF export options to the specified values. If you do not specify DXF export options within the Command File the settings currently set within Scan2CAD will be used.

This command overides any previously set DXFVersion command.

 

SaveVector

No arguments.

Saves the currently loaded vector image.

If the vector image is the result of a vectorization run it will be saved using the same name as the raster image that was vectorized. For example if a raster image called floorplan.tif has been vectorized, the vector image will be saved as floorplan.dxf.

If the vector image was loaded using the LoadVector command it will be saved using the current file name and type. For example if the currently loaded vector image is called floorplan.plt, it will be saved as floorplan.plt.

 

SaveVectorDXF

No arguments.

Saves the currently loaded vector image in DXF format.

If the vector image is the result of a vectorization run it will be saved using the same name as the raster image that was vectorized. For example if a raster image called floorplan.tif has been vectorized, the vector image will be saved as floorplan.dxf.

If the vector image was loaded using the LoadVector command it will be saved using the current file name. For example if the currently loaded vector image is called floorplan.plt, it will be saved as floorplan.dxf.

 

SaveVectorNC

No arguments.

Saves the currently loaded vector image in G-Code format with a .nc file extension.

If the vector image is the result of a vectorization run it will be saved using the same name as the raster image that was vectorized. For example if a raster image called floorplan.tif has been vectorized, the vector image will be saved as floorplan.nc.

If the vector image was loaded using the LoadVector command it will be saved using the current file name. For example if the currently loaded vector image is called floorplan.dxf, it will be saved as floorplan.nc.

 

SaveVectorHPGL

No arguments.

Saves the currently loaded vector image in HPGL format with a .hpgl extension.

If the vector image is the result of a vectorization run it will be saved using the same name as the raster image that was vectorized. For example if a raster image called floorplan.tif has been vectorized, the vector image will be saved as floorplan.hpgl.

If the vector image was loaded using the LoadVector command it will be saved using the current file name. For example if the currently loaded vector image is called floorplan.dxf, it will be saved as floorplan.hpgl.

 

SaveVectorHPG

No arguments.

Saves the currently loaded vector image in HPGL format with a .hpg extension.

If the vector image is the result of a vectorization run it will be saved using the same name as the raster image that was vectorized. For example if a raster image called floorplan.tif has been vectorized, the vector image will be saved as floorplan.hpg.

If the vector image was loaded using the LoadVector command it will be saved using the current file name. For example if the currently loaded vector image is called floorplan.dxf, it will be saved as floorplan.hpg.

 

SaveVectorHGL

No arguments.

Saves the currently loaded vector image in HPGL format with a .hgl extension.

If the vector image is the result of a vectorization run it will be saved using the same name as the raster image that was vectorized. For example if a raster image called floorplan.tif has been vectorized, the vector image will be saved as floorplan.hgl.

If the vector image was loaded using the LoadVector command it will be saved using the current file name. For example if the currently loaded vector image is called floorplan.dxf, it will be saved as floorplan.hgl.

 

SaveVectorPLT

No arguments.

Saves the currently loaded vector image in HPGL format with a .plt extension.

If the vector image is the result of a vectorization run it will be saved using the same name as the raster image that was vectorized. For example if a raster image called floorplan.tif has been vectorized, the vector image will be saved as floorplan.plt.

If the vector image was loaded using the LoadVector command it will be saved using the current file name. For example if the currently loaded vector image is called floorplan.dxf, it will be saved as floorplan.plt.

 

SaveVectorWMF

No arguments.

Saves the currently loaded vector image in WMF format.

If the vector image is the result of a vectorization run it will be saved using the same name as the raster image that was vectorized. For example if a raster image called floorplan.tif has been vectorized, the vector image will be saved as floorplan.wmf.

If the vector image was loaded using the LoadVector command it will be saved using the current file name. For example if the currently loaded vector image is called floorplan.dxf, it will be saved as floorplan.wmf.

 

In order to save a vector image in WMF format Scan2CAD needs a dpi value. This will normally be stored in the header of your raster image but if your raster images do not contain this information or if you are converting a vector image you will need to use the ScaleSettings command to set a dpi before using SaveVectorWMF.

To tell whether dpi information is stored in your raster images load a raster image into Scan2CAD and go to File Menu > Raster > Statistics. If the DPI box in File Menu > Raster > Statistics contains a value of 0 the image does not contain dpi information.

For example:

SCALESETTINGS

1

1

200

1

SAVEVECTORWMF

 

SaveVectorEMF

No arguments.

Saves the currently loaded vector image in EMF format.

If the vector image is the result of a vectorization run it will be saved using the same name as the raster image that was vectorized. For example if a raster image called floorplan.tif has been vectorized, the vector image will be saved as floorplan.emf.

If the vector image was loaded using the LoadVector command it will be saved using the current file name. For example if the currently loaded vector image is called floorplan.dxf, it will be saved as floorplan.emf.

 

In order to save a vector image in EMF format Scan2CAD needs a dpi value. This will normally be stored in the header of your raster image but if your raster images do not contain this information or if you are converting a vector image you will need to use the ScaleSettings command to set the dpi before using SaveVectorEMF.

To tell whether dpi information is stored in your raster images load a raster image into Scan2CAD and go to File Menu > Raster > Statistics. If the DPI box in File Menu > Raster > Statistics contains a value of 0 the image does not contain dpi information.

For example:

SCALESETTINGS

1

1

200

1

SAVEVECTOREMF

 

SaveVectorSVG

No arguments.

Saves the currently loaded vector image in SVG format.

If the vector image is the result of a vectorization run it will be saved using the same name as the raster image that was vectorized. For example if a raster image called floorplan.tif has been vectorized, the vector image will be saved as floorplan.svg.

If the vector image was loaded using the LoadVector command it will be saved using the current file name. For example if the currently loaded vector image is called floorplan.dxf, it will be saved as floorplan.svg.

 

You can specify whether the currently loaded raster image is included in the SVG file by use of the SVGAttachRaster command.

 The SVGAttachRaster should precede the SaveVectorSVG command.

 The SVGAttachRaster has 1 argument, 0 = exclude, 1 = include.

For example:

SVGATTACHRASTER

1

SAVEVECTORSVG

 

You can specify whether any vector line width data associated with the currently loaded vectors is saved in the SVG file by use of the SVGIncludeVectorLineWidths command.

 The SVGIncludeVectorLineWidths should precede the SaveVectorSVG command.

 The SVGIncludeVectorLineWidths has 1 argument, 0 = exclude, 1 = include.

For example:

SVGINCLUDEVECTORLINEWIDTHS

1

SAVEVECTORSVG

 

SaveVectorSVGZ

No arguments.

Saves the currently loaded vector image in SVGZ (compressed SVG) format.

If the vector image is the result of a vectorization run it will be saved using the same name as the raster image that was vectorized. For example if a raster image called floorplan.tif has been vectorized, the vector image will be saved as floorplan.svgz.

If the vector image was loaded using the LoadVector command it will be saved using the current file name. For example if the currently loaded vector image is called floorplan.dxf, it will be saved as floorplan.svgz.

 

You can specify whether the currently loaded raster image is included in the SVGZ file by use of the SVGAttachRaster command.

 The SVGAttachRaster should precede the SaveVectorSVGZ command.

 The SVGAttachRaster has 1 argument, 0 = exclude, 1 = include.

For example:

SVGATTACHRASTER

1

SAVEVECTORSVGZ

 

You can specify whether any vector line width data associated with the currently loaded vectors is saved in the SVGZ file by use of the SVGIncludeVectorLineWidths command.

 The SVGIncludeVectorLineWidths should precede the SaveVectorSVGZ command.

 The SVGIncludeVectorLineWidths has 1 argument, 0 = exclude, 1 = include.

For example:

SVGINCLUDEVECTORLINEWIDTHS

1

SAVEVECTORSVGZ

 

SaveAsVector

VectorFileName

One argument.

Saves the currently loaded vector image using a specified name and format. The image will be saved in the format specified by the extension you give. This can be any of the following: .dxf, .hpgl, .hpg, .hgl, .plt, .wmf, .emf, .nc

The following example code will save the currently loaded vector image as a DXF file called floorplan1.dxf:

SAVEASVECTOR

c:\users\username\documents\scan2cadv8\samples\floorplan1.dxf

 

In order to save a vector image in WMF or EMF format Scan2CAD needs a dpi value. This will normally be stored in the header of your raster image but if your raster images do not contain this information or if you are converting a vector image you will need to use the ScaleSettings command to set the dpi before using SaveAsVector.

To tell whether dpi information is stored in your raster images load a raster image into Scan2CAD and go to File Menu > Raster > Statistics. If the DPI box in File Menu > Raster > Statistics contains a value of 0 the image does not contain dpi information.

For example:

SCALESETTINGS

1

1

200

1

SAVEASVECTOR

c:\users\username\documents\scan2cadv8\samples\floorplan1.wmf

 

OnExitSaveAsVector

VectorFileName

One argument.

Saves the currently loaded vector image using a specified name when the user exits Scan2CAD using File Menu > Exit or one of the Close options available on the Title Bar.

The vector image will be saved in DXF pre 14 format. Any Bezier curves in the image will be saved in the DXF file as arcs.

The following example code will save the currently loaded vector image as a DXF file called floorplan1.dxf when the user exits Scan2CAD:

ONEXITSAVEASVECTOR

c:\users\username\documents\scan2cadv8\samples\floorplan1.dxf

 

LoadVector

VectorFileName

One argument.

Loads a vector image, including the vector entities in a PDF file.

If the PDF file is a multi-page file, only the first page will be loaded. To process both the raster and vector entities in a PDF file, and to process multi-page PDF files, use BatchSettings followed by BatchByDirectory.

The following example code will load the vector image floorplan.plt:

LOADVECTOR

c:\users\username\documents\scan2cadv8\samples\floorplan.plt

 

HPGLMirrorVert

Yes or No 1 = yes, 0 = no

One argument.

Mirrors an HPGL file vertically.

 

HPGLMirrorHoriz

Yes or No 1 = yes, 0 = no

One argument.

Mirrors an HPGL file horizontally.

 

Rasterize1Bit

No arguments.

Rasterizes the currently loaded vector image to a 1 Bit (black and white) raster image.

After rasterization the lines making up the raster image will be one pixel thick. To thicken the lines use the ThickenLines command.

If you save the raster image using SaveRaster it will be saved under the same name as the currently loaded vector image but with a BMP extension.

 

Rasterize4Bit

No arguments.

Rasterizes the currently loaded vector image to a 4 Bit (16 color) raster image. The colors in the vector image are mapped to the nearest colors in the AutoCAD palette.

After rasterization the lines making up the raster image will be one pixel thick. To thicken the lines use the ThickenLines command.

If you save the raster image using SaveRaster it will be saved under the same name as the currently loaded vector image but with a BMP extension.

 

Rasterize8Bit

No arguments.

Rasterizes the currently loaded vector image to an 8 Bit (256 color) raster image. The colors in the vector image are mapped to the nearest colors in the AutoCAD palette.

After rasterization the lines making up the raster image will be one pixel thick. To thicken the lines use the ThickenLines command.

If you save the raster image using SaveRaster it will be saved under the same name as the currently loaded vector image but with a BMP extension.

 

Have questions on this topic? Talk to us