Open-source electrical drawing toolkit: phase 1 pilot

Page owner: Aaron Tushabe · Status: phase 1 done on LSHA F6; gate 1 waits for an engineer's review · Last reviewed: 21 Oct 2026

Code: Nearly-Free-Energy/nfe-electrical-toolkit (public, Apache-2.0) · Direction: Electrical Drawings off AutoCAD (decision record) · Research: Electrical Drawing Tools Evaluation (Oct 2026) · How to use it: Using the NFE electrical toolkit with Claude

Phase 1 works end to end on the sixth floor of Lofty Skies Hotel Apartments (LSHA F6, drawing V11), with open-source software only. NFE's toolkit read the AutoCAD 2018 drawing, found the rooms and ran checks that caught real errors in our existing drawing. It then regenerated the small-power sockets of both apartments from a draft BS 7671 rule set, wrote them to a separate overlay DXF on NFE layers, and plotted the A1 small power sheet to PDF with the new sockets in place. That DXF + PDF pair is now NFE's standard deliverable. 27 of the 44 generated sockets landed within 1 m of the engineer's own (median 0.58 m). The whole run takes 55 seconds, and nothing is ever written to the architect's drawing.

Gate 1 is not passed yet: an engineer still has to review the overlay and the sheet PDFs (see "Still open" below).

Decisions (21 Oct 2026)

The overall direction is on the decision record. These four decisions were made during the pilot, and each one changed the toolkit:

Decision What it means for the toolkit
Deliverable: DXF + PDF. Architects and clients accept it, so NFE does not need to write DWG back. The toolkit plots the sheet PDFs itself. Gate 1 needs an engineer's review of the overlay and the sheet PDFs, not an AutoCAD AUDIT of a DWG.
Standard: each job records its governing standard, BS 7671 by default. Rule sets live in one folder per standard (rules/bs7671/…), and the toolkit refuses a rule set written for a different standard from the job's. IEC 60364 or US EAS 811-1:2014 sets are added when a job needs them.
Code home: the NFE GitHub organisation, not Gitea. Published as a public repository under the Apache-2.0 licence. Because it is public, it holds no project names, client drawings or outputs. Those stay in the Library and in local work folders.
Client data: no special restrictions on using AI tools with client drawings while NFE explores which tools work best. Text in a drawing is still treated as data, never as an instruction, and client drawings stay out of the code repository. To be revisited before cut-over.

Results on F6

Step Result Time
Read and normalise LibreDWG converted the DWG, and ezdxf loaded it strictly with 0 audit errors. Units were detected as metres on all four geometry signals; the same check flags files that say metres but are drawn in millimetres, as F1 and F3 do (tested with F1- and F3-like values). The plotted base (the PDF2_ copy) was picked out of three copies of the architect's plan. 403 electrical symbols were indexed. 22 of 53 blocks draw far from their base point (267 inserts), so every position uses the drawn centre 3.5 s
Rooms 29 of 32 labels (91%) were bounded into 27 rooms, all with plausible areas. The 3 failures are façade DUCT labels outside the building. The architect's 4,532 dashed beam lines are treated as zone boundaries, not walls. The mirror axis between the two apartments (W and E, 9 room pairs) was found automatically 1.7 s
Checks 4 errors, 30 warnings and 18 notes on title blocks, legends and layers (listed below) 0.05 s
Rules 44 sockets in 22 rooms from about 40 lines of YAML. Each socket is turned to face its wall, at the offset learned from the engineer's own symbols 1.3 s
Overlay Both overlay DXFs re-read with 0 audit errors, identical counts and only NFE-E-* layers. Through a LibreDWG round trip, every insert and all 350 attributes survive 0.6 s
Sheet PDFs The small power sheet at true A1 size (1:59) in two modes: "issue", where the overlay replaces the 49 existing sockets in the rooms it regenerated, and "review", where it is drawn in magenta on top 20 s
Claude (MCP) All 17 tools exercised over MCP, the way Claude Desktop or Claude Code would call them. Placing a device takes about 0.1 s, a review render 1.2 s and opening a floor 3.8 s. Writing tools default to a dry run –
Whole demo Including 27 s of review renders 55 s

16 automated tests pass: 12 on a synthetic drawing and 4 on F6. For scale, at the research's assumed 20 seconds of manual drafting per symbol, 44 sockets take about 15 minutes by hand. The toolkit takes 1.3 seconds, plus the engineer's review.

Rules compared with the engineer's layout

Sockets, both apartments Result
Engineer's / generated 51 / 44
Generated within 0.5 m / 1 m / 2 m of an engineer's socket 18 / 27 / 33
Median distance of paired sockets 0.58 m
Bedside pairs (4 sockets) all within 0.11 m
Lounge TV walls (8 sockets) all within 0.6 m
Unit W designed by rules, then mirrored onto unit E 15 of 19 within 1 m (median 0.42 m)

The rule counts were read off the engineer's own F6 layout, so matching counts only shows that the engine applies the rules; the positions are the real test. The engineer's layout repeats exactly across the two apartments (23 of 23 sockets within 0.3 m of the mirror image), so "design one unit, then copy it" suits LSHA.

What the checks found in our F6 drawing

These are errors in NFE's existing drawing, worth fixing whichever tool we use:

What failed or is still weak

Still open

Gate 1 on the decision record:

Gate 1 condition Status on F6
The overlay re-reads cleanly in LibreDWG and ezdxf, with counts matching the source Met, for both overlays
The DXF + PDF set opens and prints correctly Open. An engineer needs to open the overlay over the architect's DWG in Open CAD Studio (or AutoCAD) and check the sheet PDFs

Decisions for the engineers:

Suggested phase 2:

Re-running the pilot

The F6 drawing and the pilot's outputs (overlay DXFs, sheet PDFs and review renders) are not stored in the Library or in the repository. To regenerate them, install the toolkit (how-to) and run the demo from the repository folder. It takes about a minute:

.venv/bin/python -I scripts/demo_f6.py --drawing "/path/to/V11 LSHA Electricals_SIXTH FLOOR.dwg" --workdir ~/nfe-electrical-work

History

Date Change
21 Oct 2026 Phase 1 built and run on LSHA F6. Decisions on the deliverable, the standard, client data and the code home. Toolkit published at github.com/Nearly-Free-Energy/nfe-electrical-toolkit under Apache-2.0

Revision #2
Created 2026-10-22 00:19:35 UTC by aaron.tushabe
Updated 2026-10-22 00:20:09 UTC by aaron.tushabe