命令行界面
LinkCAD 可以完全通过命令行驱动,用于脚本化和自动化转换。
基本语法
linkcad.exe [options]核心参数
文件 I/O
| 参数 | 短参数 | 描述 |
|---|---|---|
--import <path> | -i | 输入文件路径 |
--export <path> | -o | 输出文件路径 |
--input-format <fmt> | 强制输入格式(默认从扩展名自动检测) | |
--output-format <fmt> | 强制输出格式(默认从扩展名自动检测) |
图层映射
| 参数 | 描述 |
|---|---|
--layer-map <path> | 加载图层映射文件 |
--apply-layer-map | 在转换期间应用已加载的图层映射 |
处理
| 参数 | 短参数 | 描述 |
|---|---|---|
--config <path> | -c | 加载命令文件(.lsn 格式) |
--top-cell <pattern> | 为分层格式选择顶层单元 | |
--apply-tool <tools> | 导入后应用工具(以分号分隔) | |
--batch-combine | 将多个输入文件合并为单个输出 | |
--units <value> | -u | 设置显示单位(1–1 000 000) |
控制
| 参数 | 短参数 | 描述 |
|---|---|---|
--quit | -q | 处理后退出(无人值守操作必需) |
--console | 启用控制台输出以便记录日志 | |
--trace | 启用详细 TRACE 级别日志记录 | |
--save-settings | 退出时保存设置(默认行为) | |
--no-save-settings | 退出时不保存设置 | |
--load-defaults | 处理前重置为默认设置 |
Python
| 参数 | 描述 |
|---|---|
--python-script <path> | 运行 Python 脚本并退出(无头模式) |
--python-cmd <code> | 执行 Python 代码字符串并退出 |
--python-interactive | 打开交互式 Python 控制台(带 GUI) |
信息
| 参数 | 描述 |
|---|---|
--help | 显示帮助文本 |
--help-all | 显示所有选项,包括格式特定的动态选项 |
有效格式名称
将这些名称与 --input-format 和 --output-format 一起使用:
| 名称 | 导入 | 导出 |
|---|---|---|
DXF | Yes | Yes |
DWG | Yes | Yes |
GDSII | Yes | Yes |
GDS-TXT | Yes | — |
CIF | Yes | Yes |
OASIS | Yes | Yes |
Gerber RS-274X | Yes | Yes |
ODB++ | Yes | Yes |
SVG | Yes | Yes |
PostScript/EPS | Yes | Yes |
PDF | Yes | — |
ACIS SAT | Yes | Yes |
Parasolid XT | — | Yes |
STEP | — | Yes |
IGES | — | Yes |
IE3D | Yes | Yes |
ANF | — | Yes |
TETIN | — | Yes |
Sonnet | Yes | Yes |
LASI TLC | Yes | Yes |
Compass Layout | Yes | — |
Modla | — | Yes |
Binary Die Format | Yes | — |
ASCII Data | Yes | — |
Raster Image (Bitmap) | Yes | Yes |
OASIS 和 ODB++ 的导入/导出需要 LinkCAD 11 或更高版本。DWG 在 LinkCAD 11 中同时支持导入和导出,而 LinkCAD 10 仅支持 DWG 导入。
示例
简单转换
linkcad.exe --import chip.gds --export chip.dxf --quit带控制台输出的转换
linkcad.exe -i chip.gds -o chip.dxf --console -q使用图层映射转换
linkcad.exe -i chip.gds -o chip.dxf ` --layer-map mapping.lmap --apply-layer-map -q选择特定顶层单元
linkcad.exe -i chip.gds --top-cell "TOPCELL" -o chip.dxf -q转换期间应用工具
linkcad.exe -i input.gds -o output.gds ` --apply-tool "Merge;SanitizePolygons" -q无头运行 Python 脚本
linkcad.exe --python-script process.py --console使用命令文件
linkcad.exe --config my_settings.lsn --console -q覆盖格式特定选项
linkcad.exe -i chip.gds -o chip.dxf --DxfOutScaling 1000 -q使用 --help-all 查看所有可用的格式特定选项。
自动化选项
这些选项控制无人值守操作,可在命令行或命令文件中设置。它们对应 Lc* 内部键名。
| 参数 | 命令文件键 | 描述 |
|---|---|---|
--load-defaults | LcLoadDefaults | 处理前重置为默认设置 |
| (command file only) | LcSkipImportOptions | 跳过导入选项对话框 |
| (command file only) | LcSkipExportOptions | 跳过导出选项对话框 |
| (command file only) | LcSkipSteps | 要跳过的向导步骤(逗号分隔) |
| (command file only) | LcSelectTopCell | 不提示而自动选择顶层单元 |
| (command file only) | LcConvertBatch | 启用批量转换模式 |
--batch-combine | LcBatchCombineFiles | 将多个文件合并为单个输出 |
--apply-layer-map | LcApplyLayerMap | 在处理期间应用图层映射 |
| (command file only) | LcNoRestart | 禁用崩溃后自动重启 |
| (command file only) | LcDeleteEmtpyCells | 导入后删除空单元 |
| (command file only) | LcDeleteUnresolvedRefs | 删除未解析的单元引用 |
| (command file only) | LcAutoAlternatePolarity | 多图层导入时自动交替极性 |
| (command file only) | LcAutoNumberMaterialValues | 自动为材料值编号 |
| (command file only) | LcAutoNumberZValues | 自动为 Z 值编号 |
| (command file only) | LcHideUnusedLayers | 导入后隐藏未使用图层 |
| (command file only) | LcInResolveLayers | 导入期间解析图层引用 |
动态选项
格式特定选项(例如 DxfOutScaling、GbrInUnits、GdsOutDbScalingUnits)可以使用其内部键名直接在命令行传递。运行 linkcad.exe --help-all 可查看按格式组织的完整列表。
每个格式页面都会在“CLI / Command-File Options”部分列出可用的选项键。
旧版参数
LinkCAD 还接受旧版 -Lc* 样式参数以保持向后兼容性。完整映射请参见 CLI 参数参考。
提示
- 无人值守/脚本化操作始终使用
--quit(或-q)— 否则 GUI 会保持打开 - 使用
--console在 stdout 上查看进度和错误消息 - 格式会从文件扩展名自动检测;使用
--input-format/--output-format覆盖 - 在脚本中使用
--no-save-settings,避免修改用户默认值 - 命令文件可以设置任何选项;显式 CLI 参数优先于命令文件中的值