Skip to content
All projects

Claude × AutoCAD

An AutoCAD plugin I built for my dad, a mechanical engineer, so Claude can take on the repetitive drafting. It works inside the live drawing and checks each step before the next.

Role
Personal project, 2026
Built with
.NET 8, ObjectARX, AutoCAD, Claude

A replay of the drafting sequence.

claude ~/claude-autocad
  1. Draft the station-3 wing rib for our SAE Aero plane: NACA 2412, 180 mm chord, spar slots at 25% and 65%, lightening holes, and dimensions.
  1. Sampling NACA 2412 at 48 points over a 180 mm chord…
  2. autocad.draw_polyline(layer: "RIB-OUTLINE", points: 48, closed: true)
  3. Closed polyline on RIB-OUTLINE, area 2,642 mm²
  4. autocad.capture_view(fit: "RIB-OUTLINE")
  5. Looked at the render: outline closed and smooth. Continuing.
  6. autocad.rectang(layer: "RIB-CUTOUTS", count: 2, at: [25%, 65%])
  7. Spar slots 6 x 12 at 45.0 and 6 x 6 at 117.0 on the camber line, min web 4.03 mm
  8. autocad.circle(layer: "RIB-CUTOUTS", count: 4, diameter: "largest whole mm with a 4 mm web")
  9. 4 lightening holes, Ø9 to Ø13, min web 4.22 mm
  10. autocad.dimension(layers: ["CENTER", "CAMBER", "DIMS"], ordinate: "from LE", overall: true)
  11. Chord datum, camber line, 6 centre marks; 7 ordinates from the leading edge, 180 overall
  12. autocad.mleader(layer: "DIMS", tags: 6)
  13. Tagged H1, H2, H3, H4 and S1, S2, spar callouts on the slots
  14. autocad.capture_view(fit: "extents")
  15. Looked at the render: tags clear of the part and of each other.
  16. Station-3 rib drafted: 35 entities on 5 layers, saved to SAE_Aero_Wing_Rib_STA3.dwg
>
StartSAE_Aero_Wing_Rib_STA3.dwg
026456282101117180H1 Ø10S1 SLOT 6 x 12MAIN SPAR, 25% CH2 Ø13H3 Ø11H4 Ø9S2 SLOT 6 x 6REAR SPAR, 65% C
MLEADER Specify leader landing location:
Command: QSAVE
026456282101117180H1 Ø10S1 SLOT 6 x 12MAIN SPAR, 25% CH2 Ø13H3 Ø11H4 Ø9S2 SLOT 6 x 6REAR SPAR, 65% C
Part
Station-3 wing rib
Profile
NACA 2412, 180 mm chord
Drawn by
Claude × AutoCAD
File
SAE_Aero_Wing_Rib_STA3.dwg

My dad is a mechanical engineer, and a lot of his time in AutoCAD goes to HVAC and mechanical drawings. By the time he opens the file, the engineering is done. What's left is drafting: the same commands, layers and dimensions, drawing after drawing. I wanted him to describe a part once and get back a drawing he could keep editing.

The first version drew blind

I started outside AutoCAD. Claude wrote Python scripts that drove the open drawing over COM. It worked, but it was fragile. AutoCAD rejects COM calls while it's busy, so every call needed a retry. A script could only reach the active document, and Claude couldn't see what it had drawn, so one misplaced line led to the next.

Moving inside AutoCAD

The plugin is a .NET 8 assembly built on ObjectARX, AutoCAD's own API, and it loads into AutoCAD itself. It listens on a local port for JSON requests, so each step is a single tool-style call like "add a layer", "draw this polyline" or "dimension these two points", not a typed command. AutoCAD only lets its main thread change a drawing, so the plugin queues requests and runs each one under a document lock and in its own transaction. A step that fails leaves the drawing as it was.

Checking before continuing

After each step, Claude looks at the drawing and reads back what is actually there, then compares it with what it meant to draw before adding more geometry. The drafting rules live in plain files: layer names, linetypes, dimension styles and a review checklist. When a drawing gets corrected by hand, the correction goes back into those rules, so the next drawing starts closer.

A test part

I tested it on a wing rib from my SAE Aero team's plane: a NACA 2412 section with a 180 mm chord, spar slots at 25% and 65% of the chord, and four lightening holes, each leaving at least 4 mm of material to the skin. The DWG is the drawing Claude produced. The animation above recreates its drafting sequence.