Skip to content

Batch Mode

Batch mode converts multiple files in a single operation using the same format and option settings.

Using Batch Mode in the GUI

  1. On the format selection page of the conversion wizard, select the input and output formats and check Batch mode.
  2. On the Select Batch Files page, add files using Add File… or Add Folder…. For a format that reads several files into one drawing (Gerber, for example), Combine files into single output converts each folder’s files together.
  3. Configure the import format options.
  4. Configure the export format options.
  5. Choose the tools to apply on the Batch Tools page.
  6. The Batch Conversion page converts the files and lists each file’s result.

Each output file is written beside its input, with the input’s name and the output format’s extension; (2), (3), … is added when a file of that name exists.

Unattended Batch from a Command File

A command file that sets LcConvertBatch=true and skips the file selection takes its files from LcImportFile: a folder stands for every file in it, and a file name may contain the wildcards * and ?. With all steps skipped, the batch runs without a window and LinkCAD exits when it is done:

[LinkCAD]
LcLoadDefaults=true
LcConvertBatch=true
LcImportFormat=GDSII
LcExportFormat=DXF
LcImportFile=C:\designs\*.gds
LcSkipSteps=all
Terminal window
linkcad.exe --config batch.lsn --console

The exit code is 1 when no file matches or a file fails to convert. LinkCAD 10 batch command files, which list the batch steps in LcSkipSteps instead of all, work unchanged.

Batch Mode from the Command Line

Use a command file to configure all options, then invoke LinkCAD once per input file:

Single conversion

Terminal window
linkcad.exe --import chip.gds --export chip.dxf --output-format DXF --quit

Loop over files (PowerShell)

Terminal window
Get-ChildItem *.gds | ForEach-Object {
$out = $_.BaseName + ".dxf"
linkcad.exe --import $_.FullName --export $out --output-format DXF --quit --console
}

Loop over files (cmd)

Terminal window
for %%f in (*.gds) do (
linkcad.exe --import "%%f" --export "%%~nf.dxf" --output-format DXF --quit --console
)

Using a command file for shared settings

Terminal window
Get-ChildItem *.gds | ForEach-Object {
$out = $_.BaseName + ".dxf"
linkcad.exe --config my_settings.lsn `
--import $_.FullName --export $out --output-format DXF --quit --console
}

The command file sets format options (DXF scaling, GDS units, etc.), while --import and --export override the file paths for each iteration. See Command Files for the file format.

Batch Tools

When batch mode is enabled in the GUI, LinkCAD can apply a set of tools to each file automatically. These are configured on the Batch Tools page of the wizard:

GUI groupCommand-file keyDescription
Merge OverlappingLcBatchToolsMergeMerge overlapping shapes on each layer
De-embedLcBatchToolsDeembedRemove embedded polygons
Convert to OutlineLcBatchToolsOutlineConvert selected shape types to polygon outlines
Detect quasi-circlesLcBatchToolsQuasiCirclesConvert quasi-circles to true circles

The Convert to Outline group uses the same shape-selection options as Tools → Shape Operations → Explode to Polygons. Its command-file sub-options include:

Sub-optionKeyDescription
Polylines with widthToolConvertWiresConvert non-zero-width polylines/wires to polygon outlines
Zero-width closed polylinesToolConvertZeroWidthClosedPolylinesConvert closed zero-width polylines to polygons independently of wide polylines
CirclesToolConvertCirclesConvert circles to polygons
DonutsToolConvertDonutsConvert donuts using the selected donut style
Donut styleToolConvertDonutsStyle0 = Single Outline, 1 = Half Donuts
TextToolConvertTextConvert text to polygons
Arc PrecisionToolArcPrecValue, ToolArcPrecUnitsPrecision for curve approximation

These can be set in command files using their key names. From the command line, use --apply-tool with semicolon-separated tool names:

Terminal window
linkcad.exe -i input.gds -o output.gds --output-format GDSII `
--apply-tool "Merge;Deembed" --quit

Tips

  • Use --console in scripts to see per-file progress and errors
  • Use --no-save-settings to avoid each conversion overwriting the user’s saved defaults
  • A command file can pre-set all format-specific options; CLI arguments override values from the command file
  • For very large batches, consider writing a Python script using the Python API for more control over the conversion pipeline