Skip to content

Command Files

A command file (also called a session file) is an INI-format text file with a .lsn extension that sets any combination of LinkCAD options. Command files are used to share settings between machines, automate repetitive conversions, and restore saved sessions.

File Format

Command files use the standard INI format with a required [LinkCAD] section header:

[LinkCAD]
LcImportFormat=GDSII
LcExportFormat=DXF
LcImportFile=C:\designs\chip.gds
LcExportFile=C:\output\chip.dxf

Syntax Rules

  • The [LinkCAD] section header is required (case-insensitive)
  • Lines before the section header are ignored
  • Each option is on its own line: OptionName=value
  • Values may be quoted: LcImportFile="C:\path with spaces\file.gds"
  • Whitespace around = and around values is trimmed
  • Empty values are ignored

ToolApply

Multiple ToolApply lines are allowed and are concatenated with ; separators:

[LinkCAD]
ToolApply=Merge
ToolApply=SanitizePolygons

This is equivalent to:

[LinkCAD]
ToolApply=Merge;SanitizePolygons

Using Command Files

From the GUI

  • File → Load Session (Ctrl+O) loads a .lsn file and applies all its options
  • File → Save Session (Ctrl+S) writes the current options to a .lsn file

From the Command Line

linkcad.exe --config my_settings.lsn --console --quit

Options passed on the command line take precedence over values in the command file. This lets you use a command file for shared settings while overriding specific values per invocation:

linkcad.exe --config gds_to_dxf.lsn `
    --import chip_a.gds --export chip_a.dxf --quit

Common Options

Core Options

Option Type Description
LcImportFile string Input file path
LcExportFile string Output file path
LcImportFormat string Import format name (e.g. GDSII, DXF)
LcExportFormat string Export format name (e.g. DXF, CIF)
LcConvertBatch boolean Enable batch conversion mode
LcBatchCombineFiles boolean Combine multiple files into single output
LcApplyLayerMap boolean Apply layer map during conversion
ToolApply string Tools to apply (semicolon-separated)

DXF Options (examples)

Option Type Description
DxfOutScaling real Output scaling factor
DxfOutBinary boolean Write binary DXF
DxfOutFormatVersion string DXF version (e.g. 2000)
DxfInScaling real Import scaling factor
DxfInExplodeSplines boolean Convert splines to polylines

GDSII Options (examples)

Option Type Description
GdsOutDbScalingUnits integer Database units
GdsOutDbScalingValue real Database scaling value
GdsInIgnoreText boolean Skip text elements on import

Gerber Options (examples)

Option Type Description
GbrInUnits integer Import units
GbrOutDecimals integer Output decimal places
GbrOutAbsCoordinate boolean Use absolute coordinates

Tip

Run linkcad.exe --help-all to see the complete list of all available options.

Example: GDS to DXF Conversion

[LinkCAD]
LcLoadDefaults=true
LcImportFormat=GDSII
LcExportFormat=DXF
LcImportFile=C:\designs\chip.gds
LcExportFile=C:\output\chip.dxf
DxfOutScaling=1000
DxfOutFormatVersion=2000
ToolApply=SanitizePolygons

Example: Gerber Import with Tools

[LinkCAD]
LcLoadDefaults=true
LcImportFormat=Gerber RS-274X
LcExportFormat=GDSII
GbrInUnits=4
ToolApply=Merge
ToolApply=Deembed

How Sessions Relate to Command Files

Session files and command files use the same .lsn format. When you save a session in the GUI, LinkCAD writes all currently recorded options to the file. When you load a session or use --config, LinkCAD reads the file using the same INI parser. See Sessions for more about session management.