← Back to Skills Marketplace
mapleslove

Dxf Handle

by mapleslove · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
413
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install dxf-handle
Description
DWG/DXF CAD 图纸处理工具。使用 ezdxf 读取图纸,遍历图层信息,计算面积或周长。适用于室内设计房间量房统计。
README (SKILL.md)

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
Usage Guidance
这项技能在用途与实现上是自洽的:它在本地解析 DWG/DXF 文件并基于本地 layers.json 计算面积/周长。安装前请注意:1) 按说明使用 pip 安装 ezdxf(只安装受信任包);2) 仅对来自可信来源的 DWG/DXF 文件运行解析器,解析不受信任或畸形文件可能导致异常;3) 若使用 --output 指定路径,注意不要无意中覆盖重要文件;4) 若你在受限环境(例如企业网络或沙箱)使用,确保遵守组织的第三方代码政策。总体上该技能没有请求凭据或网络访问,风险较低。
Capability Analysis
Type: OpenClaw Skill Name: dxf-handle Version: 1.0.0 The skill bundle is a legitimate utility for processing DXF/DWG CAD files to calculate area and perimeter measurements. The Python script (scripts/dxf_handle.py) uses the standard ezdxf library to perform geometric calculations and provides functionality to export results to CSV. No evidence of malicious intent, data exfiltration, or suspicious execution patterns was found in the code or instructions.
Capability Assessment
Purpose & Capability
名称与描述(DWG/DXF 图纸层遍历与面积/周长计算)与包含的脚本和 references/layers.json 相符;所需资源(仅需 ezdxf 库)合理且与目的直接相关。
Instruction Scope
SKILL.md 明确指示安装 ezdxf 并提供本地文件路径、图层配置和查询类型。运行时只读取指定的 DWG/DXF 文件和本地的 layers.json,并可写入用户指定的 CSV 输出;没有指示读取其它系统文件或上传数据到外部端点。
Install Mechanism
没有内置的安装脚本,SKILL.md 建议通过 pip 安装 ezdxf(常见的 Python 库)。没有从不受信任 URL 下载或在安装时写入非标准位置。
Credentials
不要求任何环境变量、凭据或配置路径。脚本只访问用户提供的 DWG 文件和包含的 references/layers.json,所请求的权限与功能匹配。
Persistence & Privilege
没有设置 always:true,也不修改其它技能或全局代理配置。默认的自主调用权限未被滥用或扩展。
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install dxf-handle
  3. After installation, invoke the skill by name or use /dxf-handle
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of dxf-handle - Provides a command-line tool for DWG/DXF CAD file processing using ezdxf. - Supports area and perimeter calculations for all or single configured CAD layers. - Requires a configurable JSON file to define target layers and their room descriptions. - Offers result export in CSV format. - Includes detailed usage instructions and sample outputs in Chinese.
Metadata
Slug dxf-handle
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Dxf Handle?

DWG/DXF CAD 图纸处理工具。使用 ezdxf 读取图纸,遍历图层信息,计算面积或周长。适用于室内设计房间量房统计。 It is an AI Agent Skill for Claude Code / OpenClaw, with 413 downloads so far.

How do I install Dxf Handle?

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

Is Dxf Handle free?

Yes, Dxf Handle is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Dxf Handle support?

Dxf Handle is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Dxf Handle?

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

💬 Comments