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, and in other sections, are ignored
- Each option is on its own line:
OptionName=value; option names are not case-sensitive - Values may be quoted:
LcImportFile="C:\path with spaces\file.gds" - Whitespace around
=and around values is trimmed - Empty values are ignored
- Booleans are
true/false,yes/noor1/0 - An option given twice takes the later value
LcCommandFile=other.lsnreads another command file at that point; later lines override it- The core options may also use their command-line names (
layer-map,quit) or LinkCAD 10 short names (i,o,q,c) - An option LinkCAD does not know is reported as a warning and skipped
ToolApply
Multiple ToolApply lines in a file are concatenated with ; separators, in order:
[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; a flag such as --apply-layer-map is set if either sets it. 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 --quitA command file that names the input and output files and the output format converts unattended with --quit, or with LcExitWhenFinished=true in the file; see Unattended Conversion. A command file that cannot be read is an error.
Resetting to Defaults
LcLoadDefaults=true, the first line of every saved session, resets all conversion settings to their defaults before the rest of the file is applied, so the file reproduces the conversion it describes rather than one shaped by the settings left from earlier work. Application settings are kept: the license, window layout, language, recent files, viewer preferences. When the settings are saved on exit, the reset settings are saved at their defaults.
A file included part-way through with LcCommandFile that starts with LcLoadDefaults=true resets the settings given before it; lines after it, and the command line, still apply.
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) |
LcLayerMap | string | Layer map file |
LcApplyLayerMap | boolean | Apply layer map during conversion |
LcTopCellPattern | string | Top cell to convert |
LcExitWhenFinished | boolean | Exit when the conversion is done (--quit) |
LcLoadDefaults | boolean | Reset conversion settings to defaults; see Resetting to Defaults |
LcSkipSteps | string | Wizard steps to skip: all, or step names separated by ; |
LcConvertBatch | boolean | Enable batch conversion mode |
LcBatchCombineFiles | boolean | Combine multiple files into single output |
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, and LinkCAD 10 session files work unchanged. When you save a session in the GUI, LinkCAD writes all currently recorded options to the file. Loading a session in the GUI and passing it with --config apply it the same way. See Sessions for more about session management.