← 返回 Skills 市场
137984917-cyber

CAD批量处理

作者 137984917-cyber · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
239
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install cad-batch-processing
功能描述
提供CAD文件批量读取、文字替换、图层重命名、块属性修改和图纸自动生成等室内设计自动化处理功能。
使用说明 (SKILL.md)

CAD批量处理 - AutoCAD自动化工具

功能

满足室内设计师对CAD图纸批量处理需求:

1. 📥 读取/解析DWG/DXF

  • 提取图层信息(名称/颜色/线型)
  • 提取所有文字坐标内容
  • 提取块和块属性
  • 提取线段坐标
  • 输出JSON格式方便后续处理

2. ✏️ 批量修改

  • 批量文字替换:文件夹内所有DXF替换指定文字(比如改项目名称、图框信息)
  • 重命名图层:批量修改图层名称
  • 修改块属性:修改图框块的属性值(项目名称、日期等)
  • 修改图层颜色:批量调整图层颜色

3. 📐 生成DXF

  • 按指令添加墙线(支持指定厚度)
  • 添加窗户
  • 添加门(带开启弧线)
  • 添加尺寸标注
  • 添加文字标注
  • 自动生成平面/立面DXF,可直接在AutoCAD打开编辑

4. 📦 批量处理

  • 批量重命名:按前缀+序号批量重命名
  • 自动备份:整个项目文件夹备份CAD文件
  • PDF添加水印:给导出的PDF批量添加工作室水印
  • 批量导出PDF:框架已搭,可适配本地CAD命令行导出

安装依赖

pip install ezdxf
# 如果需要PDF水印功能,额外安装:
pip install PyPDF2 reportlab

使用方法

提取信息

# 提取所有信息到JSON
python cad_utils.py input.dxf output.json

批量修改

# 批量替换文字(整个文件夹)
python batch_modify.py text ./project "旧项目名" "新项目名"

# 重命名图层
python batch_modify.py layer drawing.dxf "旧层名" "新层名"

# 修改块属性
python batch_modify.py attr drawing.dxf "TitleBlock" "ProjectName" "新项目名称"

# 修改图层颜色
python batch_modify.py color drawing.dxf "WALL" 7

生成图纸

from generate_dwg import CADGenerator
gen = CADGenerator()
# 添加外墙
gen.add_wall((0, 0), (6000, 0), 240)
gen.add_wall((0, 0), (0, 4000), 240)
# 添加窗
gen.add_window((2000, 4000), 2000)
# 添加门
gen.add_door((120, 1500), 900)
# 保存
gen.save("output.dxf")

批量处理

# 批量重命名
python batch_export.py rename ./dwg "项目名-" 1

# 自动备份
python batch_export.py backup ./项目 ./项目_backup

# PDF添加水印
python batch_export.py watermark input.pdf output.pdf "温州隐室空间设计"

适用场景

  • 项目改名批量改图框文字
  • 新项目快速生成基础平面
  • 批量导出PDF给客户
  • 项目归档自动备份重命名
  • 整理图纸统一图层规范

作者

温州隐室空间设计 · 数字化项目部(铁臂)

安全使用建议
This skill appears to be what it claims: local CAD batch-processing scripts using ezdxf and optional PDF libraries. Before installing/ running: 1) Review and run the code on a copy of your project (batch operations will rename/overwrite files). 2) Install dependencies from PyPI (pip install ezdxf; PyPDF2/reportlab only if you need PDF watermarking). 3) The PDF export step is a stub: you must have a local CAD tool that can export DXF→PDF and integrate the appropriate command. 4) Verify there are no unexpected network calls (the source here has none) and only run these scripts from a trusted origin. If you need higher assurance, inspect the files locally line-by-line or run in an isolated environment.
功能分析
Type: OpenClaw Skill Name: cad-batch-processing Version: 1.0.0 The skill bundle provides a legitimate set of tools for automating AutoCAD (DXF) file processing, including batch renaming, text replacement, layer modification, and basic geometry generation. The code utilizes standard libraries such as `ezdxf`, `PyPDF2`, and `reportlab` to perform file operations that are strictly aligned with the stated purpose of assisting interior designers. No evidence of data exfiltration, malicious execution, or prompt injection was found across the scripts (batch_export.py, batch_modify.py, cad_utils.py, generate_dwg.py) or documentation.
能力评估
Purpose & Capability
Name/description (批量读取、替换、重命名、生成DXF等) match the provided Python scripts (cad_utils.py, batch_modify.py, batch_export.py, generate_dwg.py). Required capabilities (ezdxf, optional PyPDF2/reportlab) are appropriate for the stated functionality.
Instruction Scope
SKILL.md instructs local file operations and usage of the included scripts. The runtime instructions only reference local files and expected local CAD command-line exporters; there are no instructions to read unrelated system files, environment variables, or to send data to external endpoints.
Install Mechanism
This is instruction-only (no install spec). It relies on Python and pip-installable libraries (ezdxf, optional PyPDF2/reportlab). That is reasonable; the package does not download code from arbitrary URLs. Note: batch_export.pdf suggests using local CAD CLI tools (AutoCAD/LibreCAD) but leaves conversion commands as placeholders—user must supply a suitable exporter.
Credentials
No environment variables, credentials, or config paths are requested. The scripts operate on local files only and do not attempt to access unrelated secrets or system configs.
Persistence & Privilege
Skill is not always-enabled and does not modify other skills or system-wide agent settings. It performs local file writes (overwriting DXF/PDF) which is expected for a batch-processing tool.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cad-batch-processing
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cad-batch-processing 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
室内设计CAD图纸批量处理工具
元数据
Slug cad-batch-processing
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

CAD批量处理 是什么?

提供CAD文件批量读取、文字替换、图层重命名、块属性修改和图纸自动生成等室内设计自动化处理功能。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 239 次。

如何安装 CAD批量处理?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install cad-batch-processing」即可一键安装,无需额外配置。

CAD批量处理 是免费的吗?

是的,CAD批量处理 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

CAD批量处理 支持哪些平台?

CAD批量处理 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 CAD批量处理?

由 137984917-cyber(@137984917-cyber)开发并维护,当前版本 v1.0.0。

💬 留言讨论