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=GDSIILcExportFormat=DXFLcImportFile=C:\designs\chip.gdsLcExportFile=C:\output\chip.dxfSyntax 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=MergeToolApply=SanitizePolygonsThis is equivalent to:
[LinkCAD]ToolApply=Merge;SanitizePolygonsUsing Command Files
From the GUI
- File → Load Session (Ctrl+O) loads a
.lsnfile and applies all its options - File → Save Session (Ctrl+S) writes the current options to a
.lsnfile
From the Command Line
linkcad.exe --config my_settings.lsn --console --quitOptions 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 --quitCommon 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 |
DxfInKeepClosedZeroWidthPolylinesAsPolylines | boolean | Keep valid closed zero-width DXF polylines as polylines |
Tool Options (examples)
| Option | Type | Description |
|---|---|---|
ToolArcPrecValue | integer | Arc/curve approximation precision value |
ToolArcPrecUnits | integer | Precision mode: -1 = segments/360°, otherwise a unit enum |
ToolConvertZeroWidthClosedPolylines | boolean | Convert closed zero-width polylines to polygons in Convert to Outline / Explode to Polygons |
ToolDontExplode | boolean | Merge Shapes option Only merge polygons; legacy label: Don’t explode complex shapes |
ToolHolesModeOmitLink | boolean | Hole mode Extract holes as polygons; legacy label: Omit cut-lines in re-entrant polygons. See Merge Hole Output Modes |
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 |
Example: GDS to DXF Conversion
[LinkCAD]LcLoadDefaults=trueLcImportFormat=GDSIILcExportFormat=DXFLcImportFile=C:\designs\chip.gdsLcExportFile=C:\output\chip.dxfDxfOutScaling=1000DxfOutFormatVersion=2000ToolApply=SanitizePolygonsExample: Gerber Import with Tools
[LinkCAD]LcLoadDefaults=trueLcImportFormat=Gerber RS-274XLcExportFormat=GDSIIGbrInUnits=4ToolApply=MergeToolApply=DeembedHow 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.