Commit graph cad-editor/COMMANDS.md
Author SHA1 Message Date
Kevin Griffin
d2af4c0b34 fix(plot): never fail silently on PDF export; add EXPORTPDF <path> (#369)
Export to PDF could end in complete silence: the flow hands off to an
async rfd save dialog, and when that future resolves to None the app
mapped it straight to Task::none(). None does not only mean the user
cancelled — on Linux the XDG portal SaveFile call can fail outright
(rfd then tries a zenity fallback, which may not be installed) and the
future still just resolves to None. rfd reports those failures only
through the `log` crate, and logging is opt-in (--log / RUST_LOG), so
the reporter saw exactly what #369 describes: no dialog, no error, no
console output, no file.

- EXPORT / EXPORTPDF now accept an optional path argument that exports
  straight to the file with no dialog — both the workaround for systems
  where the native save dialog cannot open and a headless-testable
  entry point. A relative path lands next to the drawing; a missing
  extension gets .pdf.
- The dialog-None arms (PlotExportPath / PlotWindowExportPath) now push
  a command-line message pointing at EXPORTPDF <path> instead of doing
  nothing.
- The success message prints the full output path, not just the file
  name, so users can find the PDF.

Verified end to end on the real binary via --serve: LINE + CIRCLE then
EXPORTPDF <path> writes a valid PDF with the expected geometry. Both
new tests fail on the previous code.

Fixes #369

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 13:38:16 -07:00
Hakan Seven
2a72227d5d feat(attribute): route ATTMAN/BATTMAN to the attribute editor (ATTEDIT)
ATTMAN and BATTMAN previously produced a command-line listing of block
attributes. Route both to the attribute editor instead: extract the bare
ATTEDIT behavior into a shared open_attedit_dialog helper (edit the
selected block, or start the block-pick command) and call it from the
ATTEDIT, ATTMAN, and BATTMAN arms.

Kept as a match arm rather than an ocad.pgp alias so it works for
existing users, whose config pgp is only seeded on first run.

Replace the listing regression tests with one asserting ATTMAN and
BATTMAN behave byte-for-byte like ATTEDIT.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 09:37:54 +03:00
Kevin Griffin
0f6999a838 fix(blocks): make BATTMAN work instead of erroring like ATTMAN (#295)
BATTMAN matched the ATTMAN command arm but the argument was extracted
with `cmd.trim_start_matches("ATTMAN")`. "BATTMAN" has no leading
"ATTMAN" to strip, so the whole word survived as a bogus block-name
argument — BATTMAN always reported "ATTMAN: no matching block" instead
of listing attributes. `BATTMAN <name>` never matched at all.

Strip whichever keyword was actually typed (BATTMAN first, since ATTMAN
is a suffix of it) with `strip_prefix`, and match the `BATTMAN ` prefix
form too. BATTMAN now behaves identically to ATTMAN.

Adds headless regression tests driving the real dispatcher; they fail on
the previous code with the reported symptom and pass with the fix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 15:06:12 -07:00
Hakan Seven
f6a7b0885f fix(render): repaint on layer/property edits (#231)
Layer color/linetype/lineweight and MATCHPROP edits set the
document dirty flag but never bumped geometry_epoch. The wire
caches key on that epoch and bake a ByLayer entity's resolved
color at tessellation time, so they returned stale wires until
a new entity forced a rebuild. Bump geometry on those four
handlers so the edit repaints immediately.

Also remove REGEN/REGENALL/REDRAW/REDRWALL: the GPU raster
pipeline keeps the display continuously in sync, so on-demand
regen/redraw is a no-op concept in OCS.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 23:41:13 +03:00
Hakan Seven
c653a3f38e feat(commands): add FLATSHOT and CONVTOSURFACE
- FLATSHOT: project the selected solid's edges to 2D Line entities at Z=0
- CONVTOSURFACE: convert the selected solid(s) to Surface entities

Both reuse the cached B-rep's edge wires. COMMANDS.md: 219/262.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 09:16:44 +03:00
Hakan Seven
6f9565e9f7 feat(commands): add ARCHIVE / ETRANSMIT (folder package)
Package the drawing plus its referenced files (xrefs + raster images)
into a sibling "<name>_archive" folder via std::fs, reusing the
existing block_records / entities iterators. COMMANDS.md: 217/262.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 09:10:57 +03:00
Hakan Seven
f513899d49 feat(commands): add REGION (closed boundaries -> region entities)
Convert selected closed polylines and circles into Region entities,
one wire loop each (reuses acadrust Region/Wire). COMMANDS.md: 215/262.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 09:07:30 +03:00
Hakan Seven
e2a83a6487 feat(commands): add CLOSE, HIDE, VISUALSTYLES, QUICKCALC, HYPERLINK, XOPEN
Six more standard commands by reusing existing infrastructure:
- CLOSE: close the active tab (Message::TabClose)
- HIDE / VISUALSTYLES: per-viewport render mode (Message::SetRenderMode)
- QUICKCALC / QC: alias the CAL arithmetic evaluator
- HYPERLINK <url>: attach a hyperlink via the PE_URL XData record
- XOPEN: open a selected xref's source file (Message::OpenRecent)

COMMANDS.md updated to 214 done / 15 partial / 33 missing of 262.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 09:04:18 +03:00
Hakan Seven
c80cc3292c docs(commands): sync COMMANDS.md with implemented commands
Mark commands that are wired and dispatching as done: 3DARRAY, the solid
booleans (UNION/SUBTRACT/INTERSECT), the CONE/WEDGE/TORUS primitives,
LAYISO/LAYUNISO, DIST/ID/LIST inquiry, named-view VIEW, and QUIT. Refresh the
summary totals (done 141 -> 158, missing 91 -> 74).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 12:28:42 +03:00
Karim Jerbi
1e7bd1e9b2 Add TORIENT command 2026-06-17 16:36:45 +01:00
Hakan Seven
ef1f9a08d6 chore: rename H7CAD to Open CAD Studio
Joining the OpenAEC Foundation (open-aec.com). Crate/struct become
OpenCADStudio, user-facing strings use the spaced "Open CAD Studio"
form, repo URLs point to HakanSeven12/open-cad-studio. Logo (window
icon + assets/logo.svg) redrawn with OCS initials. Drop examples/
binaries — unused.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 17:16:15 +03:00
Hakan Seven
a255b99863 docs: add COMMANDS.md and update ROADMAP.md in English
- Add COMMANDS.md: full CAD command reference (256 commands across 11
  categories) with implemented/partial/missing status for each
- Update ROADMAP.md to English, remove external product name references

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 20:06:35 +03:00