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

Terminal window
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:

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

Common Options

Core Options

OptionTypeDescription
LcImportFilestringInput file path
LcExportFilestringOutput file path
LcImportFormatstringImport format name (e.g. GDSII, DXF)
LcExportFormatstringExport format name (e.g. DXF, CIF)
LcConvertBatchbooleanEnable batch conversion mode
LcBatchCombineFilesbooleanCombine multiple files into single output
LcApplyLayerMapbooleanApply layer map during conversion
ToolApplystringTools to apply (semicolon-separated)

DXF Options (examples)

OptionTypeDescription
DxfOutScalingrealOutput scaling factor
DxfOutBinarybooleanWrite binary DXF
DxfOutFormatVersionstringDXF version (e.g. 2000)
DxfInScalingrealImport scaling factor
DxfInExplodeSplinesbooleanConvert splines to polylines
DxfInKeepClosedZeroWidthPolylinesAsPolylinesbooleanKeep valid closed zero-width DXF polylines as polylines

Tool Options (examples)

OptionTypeDescription
ToolArcPrecValueintegerArc/curve approximation precision value
ToolArcPrecUnitsintegerPrecision mode: -1 = segments/360°, otherwise a unit enum
ToolConvertZeroWidthClosedPolylinesbooleanConvert closed zero-width polylines to polygons in Convert to Outline / Explode to Polygons
ToolDontExplodebooleanMerge Shapes option Only merge polygons; legacy label: Don’t explode complex shapes
ToolHolesModeOmitLinkbooleanHole mode Extract holes as polygons; legacy label: Omit cut-lines in re-entrant polygons. See Merge Hole Output Modes

GDSII Options (examples)

OptionTypeDescription
GdsOutDbScalingUnitsintegerDatabase units
GdsOutDbScalingValuerealDatabase scaling value
GdsInIgnoreTextbooleanSkip text elements on import

Gerber Options (examples)

OptionTypeDescription
GbrInUnitsintegerImport units
GbrOutDecimalsintegerOutput decimal places
GbrOutAbsCoordinatebooleanUse absolute coordinates

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.