dxf-handle

DWG/DXF CAD 图纸处理工具。使用 ezdxf 读取图纸,遍历图层信息,计算面积或周长。适用于室内设计房间量房统计。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "dxf-handle" with this command: npx skills add mapleslove/dxf-handle

Dxf-Handle

DWG/DXF 图纸图层遍历和面积/周长计算工具。

前提条件

pip install ezdxf

使用方法

使用技能时需要提供:

  1. DWG 文件路径(必填)
  2. 图层配置 JSON(必填,参考下方格式)
  3. 查询模式(四选一):
    • 全部查询面积
    • 全部查询周长
    • 单个查询面积
    • 单个查询周长

图层配置格式

references/layers.json 中配置图层:

{
  "layers": [
    {"layerName": "JS_客厅区域框线", "description": "客厅"},
    {"layerName": "JS_主卧区域框线", "description": "主卧"},
    {"layerName": "JS_次卧区域框线", "description": "次卧"},
    {"layerName": "JS_客卧1区域框线", "description": "客卧1"},
    {"layerName": "JS_客卧2区域框线", "description": "客卧2"},
    {"layerName": "JS_南阳台区域框线", "description": "南阳台"},
    {"layerName": "JS_北阳台区域框线", "description": "北阳台"},
    {"layerName": "JS_厨房区域框线", "description": "厨房"},
    {"layerName": "JS_公卫区域框线", "description": "公卫"},
    {"layerName": "JS_内卫区域框线", "description": "内卫"}
  ]
}

命令示例

1. 全部查询面积

计算所有配置图层的面积

python skills/dxf-handle/scripts/dxf_handle.py 你的图纸.dwg --type area

输出示例:

读取文件: 你的图纸.dwg
计算类型: area
配置了 10 个图层
扫描图层...
  找到: JS_客厅区域框线 (1 个多段线)
  找到: JS_主卧区域框线 (1 个多段线)

共匹配 2 个图层, 其中 2 个有有效数据
----------------------------------------
客厅: 25.60 m²
主卧: 18.20 m²

完成!

2. 全部查询周长

计算所有配置图层的周长

python skills/dxf-handle/scripts/dxf_handle.py 你的图纸.dwg --type perimeter

输出示例:

读取文件: 你的图纸.dwg
计算类型: perimeter
配置了 10 个图层
扫描图层...

共匹配 0 个图层, 其中 0 个有有效数据

未找到匹配的实体

3. 单个查询面积

查询指定房间的面积

python skills/dxf-handle/scripts/dxf_handle.py 你的图纸.dwg --query 客厅 --type area

输出示例(有图层):

客厅: 25.60 m²

输出示例(无图层):

没找到客厅图层

4. 单个查询周长

查询指定房间的周长

python skills/dxf-handle/scripts/dxf_handle.py 你的图纸.dwg --query 客厅 --type perimeter

输出示例(有图层):

客厅: 20.30 m

输出示例(无图层):

没找到客厅图层

CSV 导出

使用 --output 参数导出 CSV 文件:

python skills/dxf-handle/scripts/dxf_handle.py 你的图纸.dwg --type area -o result.csv

CSV 格式:

名称,图层,数量,面积
客厅,JS_客厅区域框线,1,25.60
主卧,JS_主卧区域框线,1,18.20

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Huo15 Openclaw Enhance

火一五·克劳德·龙虾增强插件 v5.7.8 — 全面适配 openclaw 2026.4.24:peerDep ^4.24 + build/compat 同步到 4.24 + 14 处 api.on 全部去掉 as any 改成 typed hook(hookName 联合类型 + handler 自动推断 Pl...

Registry SourceRecently Updated
General

Content Trend Analyzer

Aggregates and analyzes content trends across platforms to identify hot topics, user intent, content gaps, and generates data-driven article outlines.

Registry SourceRecently Updated
General

Prompt Debugger

Debug prompts that produce unexpected AI outputs — diagnose failure modes, identify ambiguity and conflicting instructions, test variations, compare model re...

Registry SourceRecently Updated
General

Indie Maker News

独行者 Daily - 变现雷达。读对一条新闻,少走一年弯路。每天5分钟,给创业者装上商业雷达。聚焦一人公司、副业、创业变现资讯,智能分类,行动导向。用户下载即能用,无需本地部署!

Registry SourceRecently Updated