← Back to Skills Marketplace
137984917-cyber

CAD批量处理

by 137984917-cyber · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
239
Downloads
1
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install cad-batch-processing
Description
提供CAD文件批量读取、文字替换、图层重命名、块属性修改和图纸自动生成等室内设计自动化处理功能。
README (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给客户
  • 项目归档自动备份重命名
  • 整理图纸统一图层规范

作者

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

Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install cad-batch-processing
  3. After installation, invoke the skill by name or use /cad-batch-processing
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
室内设计CAD图纸批量处理工具
Metadata
Slug cad-batch-processing
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is CAD批量处理?

提供CAD文件批量读取、文字替换、图层重命名、块属性修改和图纸自动生成等室内设计自动化处理功能。 It is an AI Agent Skill for Claude Code / OpenClaw, with 239 downloads so far.

How do I install CAD批量处理?

Run "/install cad-batch-processing" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is CAD批量处理 free?

Yes, CAD批量处理 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does CAD批量处理 support?

CAD批量处理 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created CAD批量处理?

It is built and maintained by 137984917-cyber (@137984917-cyber); the current version is v1.0.0.

💬 Comments