CAD批量处理

v1.0.0

提供CAD文件批量读取、文字替换、图层重命名、块属性修改和图纸自动生成等室内设计自动化处理功能。

1· 228·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for 137984917-cyber/cad-batch-processing.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "CAD批量处理" (137984917-cyber/cad-batch-processing) from ClawHub.
Skill page: https://clawhub.ai/137984917-cyber/cad-batch-processing
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install cad-batch-processing

ClawHub CLI

Package manager switcher

npx clawhub@latest install cad-batch-processing
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
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.
Assessment
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.

Like a lobster shell, security has layers — review code before you run it.

latestvk97bm7a96g96mvfv631jt34chh84t0aj
228downloads
1stars
1versions
Updated 2w ago
v1.0.0
MIT-0

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给客户
  • 项目归档自动备份重命名
  • 整理图纸统一图层规范

作者

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

Comments

Loading comments...