cad-automation

cad-automation is a skill for Claude Code, Codex from delancy827/cad-skills. It costs 93 tokens per session (10,858 once invoked), scanned A, original, MIT.

Guidance for automating computer-aided design (CAD), software used to create technical drawings and 3D models. It covers connecting to AutoCAD and compatible CAD programs, creating files offline, and handling drawings, layers, dimensions, blocks, and models.

In plain words
What is it for?
Generating and editing DWG or DXF drawings, managing layers and dimensions, creating 2D or 3D models, processing many files, converting formats, and checking the resulting geometry.
Why use it?
It helps an agent choose a suitable CAD method based on the available software and the required output, instead of assuming AutoCAD is installed.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Generating and editing DWG or DXF drawings, managing layers and dimensions, creating 2D or 3D models, processing many files, converting formats, and checking the resulting geometry.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/delancy827/cad-skills/cad-automation
Install

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.

Any agent
npx skills add delancy827/cad-skills --skill cad-automation
Clone the repo
git clone --depth 1 https://github.com/delancy827/cad-skills

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for cad-automation

README.md
[![agentmods](https://agentmods.dev/badge/skills/delancy827/cad-skills/cad-automation/github.svg)](https://agentmods.dev/skills/delancy827/cad-skills/cad-automation)
Your own site
<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.

agentmods 80×15 button for cad-automation

Your own site · 80×15
<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>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 10,858 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 11d ago against content hash ad4562271758, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

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.

cad-automation/SKILL.md · 1,138 lines

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

执行铁律

  1. 先判断环境:AutoCAD.Application 能连接则走 COM,不能连接则走离线 DXF。
  2. 模型空间永远按 1:1、毫米单位绘制;图纸空间只处理视口和出图比例。
  3. 每次自动绘图都要创建标准图层、锁定 WCS、清理选择集、执行 AUDIT/PURGE/ZOOM E/REGENALL
  4. 输出前至少做 L3 验证:对象数量、关键图层、关键几何尺寸、文字/标注存在性。
  5. 使用外部开源项目的思路、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)

核心踩坑

  1. pyautocad 安全数组: 坐标必须用 APoint(x,y,z) 包装
  2. COM对象生命周期: GetActiveObject失败则需Dispatch
  3. 单位: AutoCAD内部使用绘图单位,默认公制mm
  4. 中文命令: 用 acad.doc.SendCommand("_LINE ") 带下划线前缀
  5. 选择集: acad.doc.SelectionSets 使用后必须Delete(),否则累积报错
  6. 中望/浩辰兼容: pyautocad同样支持(COM接口兼容),但部分VLAX函数需要适配

一、AutoCAD 基础知识

1.1 AutoCAD 概述

Read the full file on GitHub · 1,138 lines

Changes

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.

  1. 11d ago First seen · 1,138 lines · 93 tokens per session scan A ad4562271758

Subscribe to this mod's changes

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.

Related

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.

delancy827/solidworks-skills · 78 tokens

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.

delancy827/solidworks-skills · 69 tokens

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.

nexu-io/open-design · 41 tokens

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.

nexu-io/open-design · 53 tokens

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).

nexu-io/open-design · 78 tokens

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.

Yeachan-Heo/oh-my-codex · 50 tokens