feat(automation): drive draw commands headless with coordinate args

run now feeds coordinate tokens to interactive tools: "LINE 0,0 10,10"
starts the tool, feeds the points, and terminates as if Enter were
pressed — creating real geometry through the existing command system. The
headless session also leaves the welcome (Start) tab so drawing commands
aren'\''t blocked. Verified end-to-end: LINE/CIRCLE create entities that
save and reopen.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-17 21:17:17 +03:00
commit f1a59b1094
2 changed files with 85 additions and 8 deletions

View file

@ -25,9 +25,20 @@ Every response has `"ok"`; failures carry `"error"`. `run` drives Open CAD
Studio's **own** command system — no separate bindings to maintain — so its
coverage grows with the app.
> **Status (first increment):** `run` applies synchronous commands (system
> variables, layer ops, …). Pick-based interactive commands (drawing by clicking
> points) need coordinate feeding and are not wired headless yet.
Interactive draw commands take their points as coordinate tokens; the tool is
started, the points are fed, and it is terminated as if Enter were pressed:
```
{"op":"run","cmd":"LINE 0,0 10,10 10,20"} → two Line segments
{"op":"run","cmd":"CIRCLE 5,5 3"} → centre 5,5 radius 3
```
Coordinates are `x,y` or `x,y,z`; `@dx,dy` is relative to the previous point.
Inline-argument commands (`PDMODE 3`, `LAYER Walls`) are passed through as-is.
> Coverage is growing: commands whose options are typed keywords or coordinates
> work; ones that still rely on on-screen picking (object selection by clicking)
> are being wired next.
## Python client