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 delancy827/cad-skills --skill cad-automationgit clone --depth 1 https://github.com/delancy827/cad-skillsWrote 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/delancy827/cad-skills/cad-automation)<a href="https://agentmods.dev/skills/delancy827/cad-skills/cad-automation"><img src="https://agentmods.dev/badge/skills/delancy827/cad-skills/cad-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/delancy827/cad-skills/cad-automation"><img src="https://agentmods.dev/badge/skills/delancy827/cad-skills/cad-automation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.00093 | $0.12637 |
| Opus 5.5 | $0.00037 | $0.05055 |
| Sonnet 5.5 | $0.00019 | $0.02527 |
| Haiku 4.5 | $0.00009 | $0.01264 |
Grade A, and why
cad-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 29d 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 — 1,201 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CAD 自动化绘图 Skill(优化版)
本skill提供AutoCAD自动化绘图的完整知识体系,涵盖Python COM自动化、AutoLISP插件开发、国产CAD兼容等核心内容。
0. 2026-06-11 优化版使用原则
本版把 CAD 自动化从“只会调用 AutoCAD”升级为“三栈协同”:
| 场景 | 首选技术 | 原因 | 降级方案 |
|---|---|---|---|
| 已安装 AutoCAD、要直接生成 DWG | win32com / pyautocad |
可调用真实 AutoCAD,适合出 DWG、标注、图层、打印 | SendCommand / SCR |
| 没有 CAD 软件、要稳定生成交换文件 | ezdxf |
离线生成 DXF,适合 CI、服务器、批量草图 | 生成 SVG/JSON 几何清单 |
| 参数化 3D、模具/夹具/结构件建模 | CadQuery / FreeCAD |
适合尺寸驱动和 STEP/STL 输出 | 先生成 2D 总图,再转 3D |
| 国产 CAD 兼容 | COM + 英文命令 + DXF | 中望/浩辰对 COM 和 DXF 兼容度通常较高 | AutoLISP |
执行铁律
- 先判断环境:
AutoCAD.Application能连接则走 COM,不能连接则走离线 DXF。 - 模型空间永远按 1:1、毫米单位绘制;图纸空间只处理视口和出图比例。
- 每次自动绘图都要创建标准图层、锁定 WCS、清理选择集、执行
AUDIT/PURGE/ZOOM E/REGENALL。 - 输出前至少做 L3 验证:对象数量、关键图层、关键几何尺寸、文字/标注存在性。
- 使用外部开源项目的思路、API 或示例时,在交付包中保留
ATTRIBUTION.md,注明来源、许可证和本项目的使用方式。
外部开源资料吸收范围
本 skill 只吸收公开文档中的工程方法,不复制大段源代码。参考项目:
| 项目 | 作用 | 许可证 | 使用方式 |
|---|---|---|---|
reclosedev/pyautocad |
AutoCAD ActiveX 自动化封装、坐标与对象遍历思路 | BSD-2-Clause | 作为 COM 自动化路线参考 |
mozman/ezdxf |
离线 DXF 创建/读写/修改 | MIT | 作为无 AutoCAD 环境的 fallback |
CadQuery/cadquery |
Python 参数化 3D CAD | Apache-2.0 | 作为 3D 参数化建模路线参考 |
| 开源CAD自动化项目 | 行业最佳实践参考 | 多种 | 作为技术路线与接口设计参考 |
⚠️ Python AutoCAD COM 关键踩坑
环境
- AutoCAD 2020+ (中文版), Python 3.10+ + pyautocad/pywin32, Windows 11
连接方式
| 方式 | 结果 |
|---|---|
pyautocad.Autocad(create_if_not_exists=True) |
✅ 推荐,自动处理COM |
win32com.client.Dispatch("AutoCAD.Application") |
✅ 底层连接 |
win32com.client.GetActiveObject("AutoCAD.Application") |
✅ 连接已运行的实例 |
win32com.client.Dispatch("AutoCAD.Application.24") |
✅ 指定版本(2021=24,2022=24.1,2023=24.2,2024=24.3) |
核心踩坑
- pyautocad 安全数组: 坐标必须用
APoint(x,y,z)包装 - COM对象生命周期:
GetActiveObject失败则需Dispatch - 单位: AutoCAD内部使用绘图单位,默认公制mm
- 中文命令: 用
acad.doc.SendCommand("_LINE ")带下划线前缀 - 选择集:
acad.doc.SelectionSets使用后必须Delete(),否则累积报错 - 中望/浩辰兼容: pyautocad同样支持(COM接口兼容),但部分VLAX函数需要适配
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.
- 29d ago Changed · +63 lines ea336443c0cc
- 2mo ago First seen · 1,138 lines · 93 tokens per session scan A ad4562271758
cad-automation is a skill published in the GitHub repository delancy827/cad-skills (112 stars, last pushed 1mo ago), licensed MIT. It adds 93 tokens to every session and 12,637 once invoked, about $0.0004 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.
cad-automation compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| cad-automationdelancy827/cad-skills | Skill | 112 | 1mo ago | MIT | A | 93 | Claude Code, Codex |
| webgl-holographic-foilnexu-io/open-design | Skill | 106k | yesterday | Apache-2.0 | A | 41 | Claude Code, Codex |
| html-ppt-hermes-cyber-terminalnexu-io/open-design | Skill | 106k | yesterday | Apache-2.0 | A | 53 | Claude Code, Codex |
| html-ppt-taste-brutalistnexu-io/open-design | Skill | 106k | yesterday | Apache-2.0 | A | 78 | Claude Code, Codex |
| visual-ralphYeachan-Heo/oh-my-codex | Skill | 34k | 3d ago | MIT | A | 52 | Codex |
| glance-canonical-layoutsandroid/skills | Skill | 10k | yesterday | Apache-2.0 | A | 56 | Claude Code |
| accessibilitymicrosoft/hve-core | Skill | 1.6k | yesterday | MIT | A | 47 | Claude Code |