SolidWorks Automation Skill is a Python toolkit that connects coding-agent tools to the SolidWorks API for automating CAD work. Engineers use it with SolidWorks and, for some workflows, AutoCAD through a skill package, MCP server, or desktop application. The catalogue add-ons provide workflows that operate this toolkit.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add wzyn20051216/solidworks-automation-skill --skill autocad-automationgit clone --depth 1 https://github.com/wzyn20051216/solidworks-automation-skillWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/wzyn20051216/solidworks-automation-skill/autocad-automation)<a href="https://agentmods.dev/skills/wzyn20051216/solidworks-automation-skill/autocad-automation"><img src="https://agentmods.dev/badge/skills/wzyn20051216/solidworks-automation-skill/autocad-automation/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/wzyn20051216/solidworks-automation-skill/autocad-automation"><img src="https://agentmods.dev/badge/skills/wzyn20051216/solidworks-automation-skill/autocad-automation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00151 | $0.03986 |
| Opus 5.5 | $0.00060 | $0.01594 |
| Sonnet 5.5 | $0.00030 | $0.00797 |
| Haiku 4.5 | $0.00015 | $0.00399 |
Grade A, and why
autocad-automation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 200 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AutoCAD 自动化技能
本目录作为
solidworks-automation-skill的 AutoCAD/DWG 子技能使用。父技能负责 SolidWorks 建模、装配、工程图和三维导出;本子技能负责 AutoCAD 二维 DWG/DXF 绘制、批量改图、线稿矢量化、出图预览和图纸自检。涉及 SolidWorks 原生零件/装配体建模时回到父技能,涉及 AutoCAD 图纸或 DWG/DXF 时读取本子技能。
目标
让代理在本机 Windows 桌面环境中可靠控制 AutoCAD,而不是每次凭记忆临时拼命令。默认路线是 Python + COM/ActiveX,但原生写入必须先通过 capabilities.yaml 门禁和本机真机回归;当前 AutoCAD 2024 的 Documents/Layers/SelectionSets 动态代理不稳定,因此 COM 原生 DWG 绘图按 not_implemented 处理。DXF 无头读取、预览和结构审查可直接使用。AutoCAD 2024 .NET 白名单后端已连续通过真实 DWG 保存重开、PDF/PNG 和实体/图层/尺寸回归,运行时证据完整时为 verified;只允许固定命令,不得推广成任意代码执行。
适用场景
使用本技能处理:
- 新建或修改 DWG/DXF 图纸,绘制线、圆、圆弧、多段线、矩形、文字、块、图层和简单标注。
- 批量打开 DWG,检查图层、实体数量、文字、块参照、外部参照或输出文件。
- 让 Codex 直接连接本机 AutoCAD、保存 DWG、导出 DXF/PDF,并生成复核报告。
- 编写 AutoLISP、
.scr命令脚本或 C# AutoCAD .NET 插件。 - 需要查 Autodesk 官方 API、ADN/GitHub 示例、ObjectARX SDK 或 APS Design Automation 模式。
不要把本技能用于纯渲染效果图、BIM/Revit 模型、机械 STEP-first 建模、CAM 刀路或工程认证结论;这些需求优先转给相应 CAD、BIM、仿真或制造流程。
默认假设
- 操作系统:Windows。
- AutoCAD:用户本机已安装,最好已手动启动一次完成 COM 注册。
- 自动化入口:
AutoCAD.ApplicationCOM ProgID。 - 可视化默认:新建绘图任务默认先显示并激活 AutoCAD,再逐步落图元;只有批处理或用户明确要求提速时才关闭。
- 绘图单位:默认按毫米理解;AutoCAD 数据库本身是无单位数值,必须在图纸说明中记录单位。
- 空间:几何默认进入 ModelSpace;版面、标题栏和打印配置单独处理。
- 坐标:默认 WCS,二维对象使用
Z=0。 - 输出:优先保存 DWG,同时按用户需求导出 DXF/PDF;所有输出路径使用绝对路径。
- 文件安全:修改既有 DWG 前先另存副本,除非用户明确允许覆盖。
缺少版本、单位、图纸标准、输出路径或是否允许覆盖时,先做一次简短确认。简单草图可以直接假设毫米、ModelSpace、新建 DWG,并在结果中说明。
入口自检
执行 AutoCAD 自动化前先运行:
python subskills\autocad-automation\scripts\acad_preflight.py
如果用户允许自动启动 AutoCAD:
python subskills\autocad-automation\scripts\acad_preflight.py --launch
自检失败时:
- 缺
pywin32:提示用户安装python -m pip install pywin32,得到明确同意后再安装。 - 找不到 AutoCAD COM:提示用户安装 AutoCAD、启动一次 AutoCAD,或确认安装的是 LT/受限环境。
- AutoCAD 已运行但无活动文档:可以新建文档,不要误判为连接失败。
核心工作流
- 分类任务:判断是新建图纸、修改既有 DWG、批处理、出图导出、API 开发、插件开发还是故障排查。
- 确认关键约束:单位、版本、目标文件、输出格式、是否允许覆盖、图层/线型/标注标准、是否需要按企业模板绘图。
- 运行自检:先用
acad_preflight.py确认 Python COM 和 AutoCAD 状态。 - 查证 API:未封装 API 必须先读
references/api-lookup.md,再查 Autodesk 官方文档或可信 GitHub 示例;不要猜长参数、枚举值和命令行为。 - 制定绘图计划:写明图层、坐标基准、对象清单、尺寸、文本、输出路径和复核点。
- 先把软件拉起来:连接或启动 AutoCAD,确保窗口可见并尽量切到前台,再开始落图。
- 优先复用脚本:简单几何用
scripts/acad_draw.py的 JSON 输入;复杂逻辑用scripts/acad_session.py组合 COM 调用。 - 串行执行 COM:AutoCAD 桌面 COM 操作不要并行;一个脚本连接、逐步绘制、保存、复核后退出。
- 保存和导出:保存 DWG/DXF/PDF 前确保目录存在;修改原图时保留备份或另存。
- 复核结果:运行
scripts/acad_review.py统计实体、图层、包围盒和目标文件;再运行scripts/acad_preview.py导出 AutoCAD 原生 BMP/PNG 预览,并用图片查看工具做视觉审查。窗口截图可作为补充,但若被其它窗口遮挡,不可作为通过依据。 若输入是 DXF 且只需无头只读检查,可先运行scripts/acad_headless.py;它不支持 DWG 写入,最终 DWG/PDF 仍须走 AutoCAD COM。 - 沉淀经验:遇到新坑、命令差异、版本限制或稳定封装,补进
references/troubleshooting.md或脚本。
What ships with it
18 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- dotnet/CadStudio.AutoCAD2024/CadStudio.AutoCAD2024.csproj 1.6 KB
- dotnet/CadStudio.AutoCAD2024/CadStudioCommands.cs 15 KB
- dotnet/CadStudio.AutoCAD2024/NuGet.Config 217 B
- evals/evals.json 1.3 KB
- examples/draw_mounting_plate.py 1.2 KB runs code
- manifest.yaml 839 B
- README.md 3.6 KB
- references/api-lookup.md 4.0 KB
- references/engineering-patterns.md 4.9 KB
- references/troubleshooting.md 9.9 KB
- scripts/acad_dotnet_preflight.py 11 KB runs code
- scripts/acad_dotnet_regression.py 14 KB runs code
- scripts/acad_draw.py 4.8 KB runs code
- scripts/acad_headless.py 11 KB runs code
- scripts/acad_preflight.py 4.2 KB runs code
- scripts/acad_preview.py 3.6 KB runs code
- scripts/acad_review.py 3.6 KB runs code
- scripts/acad_session.py 29 KB runs code
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 200 lines · 151 tokens per session scan A 9ae911c71a31
autocad-automation is a skill published in the GitHub repository wzyn20051216/solidworks-automation-skill (1,541 stars, last pushed today), licensed MIT. It adds 151 tokens to every session and 3,986 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
ifoxcad
Use when writing AutoCAD / ZWCAD / GstarCAD plugins in C# with IFoxCAD (NuGet IFox.CAD.ACAD 0.9.12) — DBTrans transaction wrapper, CurrentSpace.AddEntity, LayerTable.AddOrChange, block attributes, SSGet, EditorEx prompts, multi-CAD GlobalUsings aliases. Also for "eNotInDatabase" on an entity Id, entities vanishing…
qcad
Use when editing or batch-converting DXF/DWG drawings with QCAD 3.33 — RAddObjectsOperation scripting, dwginfo/dwg2pdf/dwg2svg console tools, or version conversion through qcad -no-gui -autostart SaveAs.js -filter; also when dwg2pdf/dwg2svg are missing because they ship only with QCAD Professional, when a PDF export…
autocad-mcp-premium
Use for any AutoCAD MCP Pro work whose result someone will rely on - a part drawn from a dimensioned source, an edit to an existing drawing, a P&ID, a foreign DWG/DXF to read, a plan, a takeoff, or a delivery. Teaches the measured workflow (requirements -> geometry -> verified on the CAD -> saved -> reopened ->…
fy_layout
Use when writing C# plugins for the FeiYang LightCAD/LightBIM platform (construction site layout) — ILcPlugin registration, ElementType with fixed GUID, [CommandClass]/[CommandMethod] commands, TabItem ribbon menus, 2D Action plus Shape/Solid Provider pairs for fence, lawn, foundation pit, road, prefab house. Also for…
tongwen
Use when translating engineering DWG drawings with Tongwen — TWEXTRACTALL / TWTRANSLATE / TWWRITEBACKFILE in AutoCAD 2019/2021/2025/2026, glossary CSV with CM/TM precedence, placeholder QA blocking write-back, or headless Tongwen.Runner.BatchCli -i -o -c -m runs; also when extraction fails with a Named Pipe connection…
lightningcad
Use when doing prefabricated facade/envelope panel layout and detailing inside AutoCAD, ZWCAD or GstarCAD with LightningCAD — FsInitBuilding / FsPanelLayout, FsCreateNodeLine node lines, FsShouBian trim and BOM export, LTJianChaTuZhi drawing checks; also when the plugin fails to load (TRUSTEDPATHS, .NET Framework…