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.10858 |
| Opus 5 | $0.00046 | $0.05429 |
| Sonnet 5 | $0.00019 | $0.02172 |
| Haiku 4.5 | $0.00009 | $0.01086 |
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 11d 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,138 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函数需要适配
一、AutoCAD 基础知识
1.1 AutoCAD 概述
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.
- 11d 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 (49 stars, last pushed 3mo ago), licensed MIT. It adds 93 tokens to every session and 10,858 once invoked, about $0.0005 per session on Opus 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
solidworks-automation
A SolidWorks automation guide for creating 3D models, assemblies, drawings, simulations, sheet-metal designs, molds, surfaces, and electrical designs through Python, C#, or VBA. SolidWorks is computer-aided design software used for mechanical engineering.
sw-designer
A SolidWorks design guide for making parameter-driven 3D models, where dimensions and other variables control how a design changes. It also covers automation, batches of related parts, performance, and design practices.
webgl-holographic-foil
A self-contained WebGL2 hero: thin-film interference over a crushed-foil surface whose palette shifts with the viewing angle; move the cursor to tilt the film.
html-ppt-hermes-cyber-terminal
OpenDesign + BYOK: choosing and wiring your own model, hands-on — cost, quality, and the routing decision. Built as a decision-grade AI literacy deck for engineers, IT, applied-AI teams.
html-ppt-taste-brutalist
16:9 HTML deck in tactical-telemetry / CRT-terminal taste. Deactivated-CRT charcoal slides, white-phosphor monospace, hazard-red accent, scanline overlay, ASCII syntax, density over decoration. Distilled from Leonxlnx/taste-skill brutalist-skill (Tactical Telemetry mode).
visual-ralph
Visual Ralph orchestration for frontend UI from generated references, static references, or live URL targets, using $ralph with built-in visual verdict and pixel-diff evidence until the implementation matches and leaves a reproducible design system.