mirror of
https://github.com/storytold/cadcraft.git
synced 2026-10-14 14:26:45 -04:00
* 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 <[email protected]> * 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 <[email protected]> * Dynamic block references: change the visibility state Choosing a visibility state (or a lookup value whose tables set only visibility states) in Properties ▸ Custom, or `blocks.reference.set {handle, name, value}`, changes a dynamic block reference as AutoCAD does: - The reference gets a new anonymous block: its current one with the state's objects shown and the parameter's other objects hidden (matched to the dynamic block's objects by their AcDbBlockRepETag element tags). The old anonymous block goes when nothing else uses it. - AutoCAD's link data is written: the new block's record carries AcDbBlockRepBTag (the dynamic block's record), copied objects keep their element tags, and the reference's AcDbBlockRepresentation data records the value (an existing value record is updated; a new one copies another reference's record for the same parameter when there is one). - An attribute whose definition the state hides is written hidden (60). - Changes CADCraft can't make yet (distances, positions, lookups that set them) are refused with a message and change nothing; Properties shows only what can change as a dropdown (`CustomProperty::editable`). - Tests: the synthetic DOOR references (own values and an anonymous block), survival through a save, refusals, and the engine command with undo. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Dynamic block references: distances, positions, stretch and move actions, lookup chaining Linear distances (snapped to their value sets) and point positions can be changed; the stretch and move actions that follow them run (listed vertices or whole objects, multiplier and angle offset), parameters in an action's selection are carried along, associative hatches refill from their stretched outlines and the reference's attributes move with their definitions. Lookup tables run both ways (a changed input gives its table's lookup value, which sets the other tables' inputs). Connections are read in either group order. Checked against AutoCAD's own references (*U10, *U12). Co-Authored-By: Claude Opus 5.5 <[email protected]> * Dynamic block references: record changes in the history as AutoCAD does; full value data for new references A changed reference's ACAD_ENHANCEDBLOCKHISTORY says what was done to it: a visibility state or lookup value by property name, a distance or position as the drag of its grips (GRIPLOC, how far each grip is from where the dynamic block has it). A reference that had no data gets a record for everything other references of the same dynamic block have, with its own values. Templates come only from references of the same dynamic block; anonymous copies have no units; boundary reactors follow the copies. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Dynamic block history: record only the grips a change moves AutoCAD's history holds the user's own drags; a grip that only moved with another parameter (a stretch carrying it) gets no entry. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Dynamic block history: a distance by name, as typed in Properties AutoCAD records a distance typed in Properties as the parameter's name and value in block units (1071 id, 300 Distance2, 40 40.0), replacing drags of its grips; positions stay grip drags. Co-Authored-By: Claude Opus 5.5 <[email protected]> * 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 <[email protected]> * Dynamic blocks: carried parameter points are in a stretch frame where the block has them AutoCAD evaluates actions from the dynamic block itself, so a parameter point another action has moved out of a stretch frame still follows it. Testing the current position instead changed a stretched label's width when its visibility changed (Distance2 183.75 became 184.45; AutoCAD keeps 183.75). Co-Authored-By: Claude Opus 5.5 <[email protected]> * Dynamic block grips: show and drag a dynamic reference's grips as AutoCAD does A selected dynamic block reference shows its grips: an arrow at each end of a distance, a square at a position, a down-pointing triangle for a visibility or lookup list, only those its visibility state lists. Dragging an arrow changes the distance along the parameter (snapped to its values; a typed number sets it), a square moves the position, a list grip offers its choices; actions and lookups follow, with a live preview. doc: dynblock::grips, drag_grip; grip objects by graph id. engine: blocks.reference.grips, blocks.reference.grip, Session::start_dyn_grip. ui: canvas dynamic grips (GRIPDYNCOLOR-like token), list popup. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Tests: read the shared DOOR fixture with LF line ends whatever the checkout gives Co-Authored-By: Claude Opus 5.5 <[email protected]> * Dynamic blocks: carried parameter points are in a stretch frame where the block has them AutoCAD evaluates actions from the dynamic block itself, so a parameter point another action has moved out of a stretch frame still follows it. Testing the current position instead changed a stretched label's width when its visibility changed (Distance2 183.75 became 184.45; AutoCAD keeps 183.75). Co-Authored-By: Claude Opus 5.5 <[email protected]> * Dynamic grips: Ukrainian labels for the new commands; copy the hot grip instead of cloning Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Cody Vogt <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Brandon Thomas <[email protected]>
This commit is contained in:
15 files changed
+1184
-416
No files matched your search
@@ -141,6 +141,7 @@ our output in AutoCAD black-box.
|
||||
| 2026-10-12 | minor | DXF/DWG save: the Model layout's plot settings are written as CADCraft plots model space, drawing extents scaled to fit (PLOTSETTINGS 74 = 1, 75 = 0), instead of plot type 5 "Layout information", which other programs' Plot dialogs can't use for model space |
|
||||
| 2026-10-12 | minor | VIEWPORT frozen layers also written and read as AutoCAD's group 341 layer handles, so third-party viewers honour per-viewport freezing in DXF (DWG converter gap noted) |
|
||||
| 2026-10-12 | minor | HATCH: associative hatches inside blocks keep their source objects; boundaries carry `{ACAD_REACTORS}` |
|
||||
| 2026-10-12 | minor | Dynamic block grips: grip objects read by graph id; a drag is saved as AutoCAD saves a Properties change |
|
||||
| 2026-10-12 | minor | Dynamic block references: visibility states can be changed and are saved as AutoCAD saves them |
|
||||
| 2026-10-12 | minor | Dynamic block references: definition, values and custom properties read (`blocks.reference`, Properties ▸ Custom) |
|
||||
| 2026-10-12 | minor | Dynamic block data row: parameters and actions read into a model (`blocks.dynamic`); kept by DXF and DWG save |
|
||||
|
||||
@@ -151,6 +151,7 @@ Detail: [localization-parity.md](localization-parity.md).
|
||||
| 2026-10-13 | minor | STRETCH takes crossing and window polygons (CP, WP), BOX and a fence (F), typed and as JSON (`polygon`, `fence`): F1 narrowed |
|
||||
| 2026-10-12 | minor | Property-based and hostile-input tests for geometry numerics landed (deterministic xorshift generator, no new dependency; known answers at 1e6–1e7 coordinates): S6 removed |
|
||||
| 2026-10-12 | trivial | F13: HATCHEDIT refuses a bad scale or angle before editing (#724) |
|
||||
| 2026-10-12 | minor | F3: dynamic block references show their grips (distance arrows, position squares, visibility/lookup lists, per visibility state) and drag them (`blocks.reference.grips`, `blocks.reference.grip`) |
|
||||
| 2026-10-12 | minor | SCRIPT command reading `.scr` files landed (runs a file through the same script engine as CLI/MCP; nested scripts refused): E2 removed |
|
||||
| 2026-10-11 | minor | Refreshed for merged features: code pages (#505), tracking leftovers (#441), dynamic input/grip input (#519, #425) and SPLINEDIT Join/Add/Elevate (#559) closed their top-10 rows (top 10 now has 6 rows until the next review re-ranks); MULTILEADER (#459) and xrefs (#525) narrowed rows 1 and 4; F1 narrowed to the remaining stubs (#558, #559, #547); F5, F7, F9, F12, F14, F15, F17, F20, F22, U5, U7, U10, FF2, FF4, FF10 narrowed; F18, U2, U8, U9 removed (done); U13, S3, S4, P1 updated for merged fixes |
|
||||
| 2026-10-11 | minor | German interface catalog landed: L1 row count 936 → 989, L2 narrowed (de done; 40–60 → 35–55 h) |
|
||||
|
||||
Reference in new issue
Block a user