cadcraft/docs
codyvogt 73b8edac61
Dynamic block references: custom properties in Properties (stacked on #838) (#853)
* Dynamic blocks: read parameters and actions from AutoCAD files

A dynamic block's evaluation graph (kept as foreign data since #528) is read
into a typed model, `cadcraft_doc::dynblock`, without changing the kept
data: parameters (linear with value sets, point, visibility states,
lookup, base point; polar, XY, rotation, alignment and flip by geometry)
and actions (stretch with its frame and moved vertices, lookup tables;
move, scale, rotate, flip, array, polar stretch by kind), each with its
graph id and the parameters it follows.

- `blocks.dynamic {name}` returns the model as JSON (handles as hex);
  `blocks.list` marks dynamic blocks.
- Counts and values come from the file: capped by the groups present,
  non-finite numbers and missing members skipped.
- Tests: a synthetic DOOR block (visibility, linear list, stretch, lookup),
  its survival through a save, damaged data, and the engine commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Dynamic block references: their values and custom properties

A dynamic block reference's extension dictionary says which dynamic block it
shows (AcDbBlockRepresentation ▸ AcDbRepData) and the values it was given
(AppDataCache ▸ ACAD_ENHANCEDBLOCKDATA, one XRECORD per parameter graph id).
`dynblock::reference` reads them; a reference to the dynamic block itself
has the block's values.

- `dynblock::custom_properties`: the Properties palette's Custom section, in
  parameter order, only parameters shown in Properties: visibility state,
  lookup value worked out from the lookup tables (their "no match" name, e.g.
  Custom, when the inputs match no row), distances and point positions in
  drawing units (block units × the reference's scale), with the choices of
  each (states, lookup values, a distance's list).
- Properties: a dynamic block reference shows its dynamic block's name
  instead of its anonymous block's, and a read-only Custom section.
- `blocks.reference {handle}` returns the definition, values and properties.
- Tests: synthetic references (own values, an anonymous block scaled 2, a
  width no lookup row has), survival through a save, the engine command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* DWG: dynamic block lookup parameters keep their name and lookup action

AutoCAD writes a lookup parameter's subclass marker as
AcDbBlockLookUpParameter; the DWG bridge reads AcDbBlockLookupParameter and
matches it exactly, so the parameter's name (303) and lookup action (94)
were lost in DWG files and AutoCAD's lookups stopped working (a visibility
change no longer resized the block). The bridge DXF now uses its spelling.

Found by driving AutoCAD on CADCraft's output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Cody Vogt <18035288+codyvogt@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-13 05:42:37 -04:00
..
brand M0: CADCraft skeleton and vertical slice 2026-10-05 23:22:25 -04:00
images README screenshots, alpha/parity assessment in ROADMAP, MLEADER written to DXF as LEADER + MTEXT 2026-10-06 02:12:34 -04:00
architecture.md Add German (de) interface language (#573) 2026-10-11 14:36:40 -04:00
autolisp.md AutoLISP: load and run .lsp routines (fixes #758) (#855) 2026-10-13 05:33:57 -04:00
contributors.md About: contributor and model credits compiled in (grab bag + table, self-submitted names) (#3) 2026-10-07 21:16:30 -04:00
control-protocol.md Animation effects follow the operating system's setting; View ▸ Accessibility ▸ Animation Effects (#759) 2026-10-13 05:34:56 -04:00
file-format-parity.md Dynamic block references: custom properties in Properties (stacked on #838) (#853) 2026-10-13 05:42:37 -04:00
gaps.md HATCHEDIT: refuse an explicit bad scale or angle before editing anything (#724) (#777) 2026-10-13 05:37:45 -04:00
geometry-parity.md Property-based and hostile-input tests for geometry numerics (gaps.md S6) (#733) 2026-10-13 05:16:44 -04:00
hardware-parity.md Progress docs: target-app parity, gaps, alpha gate, readiness by audience (#205) 2026-10-10 14:13:04 -04:00
localization-parity.md i18n(pt-BR): complete the Brazilian Portuguese catalog (#791) 2026-10-13 04:45:43 -04:00
localization.md i18n(pt-BR): complete the Brazilian Portuguese catalog (#791) 2026-10-13 04:45:43 -04:00
mcp.md MCP: render one area of the drawing, and read its texts (find_text) (#757) 2026-10-13 05:34:34 -04:00
parity-checklist.md MLEADEREDIT, MLEADERALIGN, MLEADERCOLLECT (#816) 2026-10-13 04:37:26 -04:00
plot-styles.md Plot styles: apply line end, join and fill styles (part of #564) (#566) 2026-10-11 13:13:32 -04:00
plotters.md Plotting: honor model-space center and X/Y offsets (#751) 2026-10-13 04:34:04 -04:00
releasing.md Release prep: 0.5.0 and Linux riscv64 release build (#423) 2026-10-10 19:15:06 -04:00
roadmap.md AutoLISP: load and run .lsp routines (fixes #758) (#855) 2026-10-13 05:33:57 -04:00
target-app-parity.md Hatch and Gradient dialog (create and edit) (#753) 2026-10-13 04:34:09 -04:00
ui-parity.md Animation effects follow the operating system's setting; View ▸ Accessibility ▸ Animation Effects (#759) 2026-10-13 05:34:56 -04:00