Install
openclaw skills install @powerzzjohn/power-cad-drafterAuto-generate electrical CAD drawings from survey data and auto-audit against power codes
openclaw skills install @powerzzjohn/power-cad-drafterAuto-generate DXF construction drawings for 10kV and below power distribution projects, and auto-audit against the company design code and national standards.
python3 -m pip install ezdxf pyyaml
Company code must exist: workspace/电力行业施工图设计规范V1.0.md
Extract structured survey data from user input or parse hand-drawn sketches via vision.
Recommended input format (YAML/JSON):
project:
name: "XX小区配电工程"
type: "residential"
survey:
building_floors: 18
units_per_floor: 6
total_area_sqm: 25000
substation_dimensions: [8.5, 6.2]
Infer design parameters per the company code:
| Item | Input | Output Rule |
|---|---|---|
| Load calculation | Area, units, load density | Demand factor method |
| Transformer | Load, location | Dry/oil, D,yn11, standard capacity |
| Main wiring | Load grade, transformer count | Single bus / sectionalized |
| Grounding | Substation location | TN-S (indoor), TN-C-S (outdoor) |
| Cable | Transformer capacity, routing | Ampacity + thermal + voltage drop |
| Room layout | Equipment count, dimensions | Aisle width, fire rating, noise |
Run scripts/dxf_generator.py to produce:
| Drawing | Suffix | Content |
|---|---|---|
| Single-line diagram | _single_line.dxf | 10kV and 0.4kV primary system |
| Layout plan | _layout.dxf | Equipment positioning, dimensions, aisles |
| Grounding plan | _grounding.dxf | Grounding electrodes, equipotential bonding |
| Cable routing | _cable.dxf | Trench/bridge paths, cable labels |
Run scripts/audit_engine.py to check against the code and produce a Markdown report.
Core checklist:
Report format:
| Category | Item | Result | Design | Required | Clause | Remark |
|----------|------|--------|--------|----------|--------|--------|
project_name_cad_package.zip containing:
drawings/ — DXF files (4 sheets)design_params.json — All inferred parametersaudit_report.md — Audit report with pass/fail and corrective actionsequipment_list.csv — Bill of materialsscripts/dxf_generator.py — Core DXF drawing engine (single-line, layout, grounding, cable)scripts/audit_engine.py — Rule-based audit engine, loads design params and checks compliancereferences/drawing_symbols.md — Drawing legend and symbol standards per GB/T 4728