feat(blocks): implement native Array action authoring and dynamic evaluation

Add the native Array action (\BARRAY\, \BACTION ARRAY\, and Authoring Palettes Actions tab \Array\) supporting Linear, Polar, and XY parameters.

Prompt for column offset (and row offset for XY), constructing native \DynamicBlockData::ArrayAction(BlockArrayAction)\ with class \AcDbBlockArrayAction\ and 4 native connections (\Base\, \End\, \UpdatedBase\, \UpdatedEnd\) bound to the parameter node ID.

Evaluate step displacement along 1D rays and 2D grids, tagging clones with deterministic element IDs to reconcile representations cleanly across incremental grip adjustments without mutating baseline geometry. Validate native DWG/DXF roundtrip, reference independence, COPY isolation, rejections, and dock palette tool state.
This commit is contained in:
Karim Jerbi committed 2026-10-17 12:49:51 +01:00
1 parent 5a6a7fab93
commit 26071f2021
14 files changed
+806 -57

No files matched your search

+25
View File
@@ -1334,6 +1334,31 @@ fn block_actions_stretch_palette_requires_distance_parameter() {
});
}
#[test]
fn block_actions_array_palette_requires_distance_parameter() {
with_stack(|| {
let mut app = authoring_app();
let _ = app.dispatch_command("BAUTHORPALETTE");
app.authoring_palette_tab = crate::ui::window::authoring_palettes::Tab::Actions;
let point = authoring_control(&app, "authoring-tool-array-action");
authoring_click(&mut app, point);
assert!(app.tabs[app.active_tab].active_cmd.is_none());
let _ = app.run_command_line("BPARAMETER POINT 0.5,0.5 0.7,0.7");
let point = authoring_control(&app, "authoring-tool-array-action");
authoring_click(&mut app, point);
assert!(app.tabs[app.active_tab].active_cmd.is_none());
let _ = app.run_command_line("BPARAMETER LINEAR 0,0 10,0 5,2");
let point = authoring_control(&app, "authoring-tool-array-action");
authoring_click(&mut app, point);
assert!(app.tabs[app.active_tab]
.active_cmd
.as_ref()
.unwrap()
.prompt()
.contains("Array"));
});
}
#[test]
fn block_actions_rotate_flip_palette_requires_matching_parameters() {
with_stack(|| {
+1
View File
@@ -416,6 +416,7 @@ impl OpenCADStudio {
self.action_error(Some(crate::scene::block_actions::Kind::Rotate)),
self.action_error(Some(crate::scene::block_actions::Kind::Flip)),
self.action_error(Some(crate::scene::block_actions::Kind::Stretch)),
self.action_error(Some(crate::scene::block_actions::Kind::Array)),
)
}
crate::ui::dock::PanelId::BlockPalette => {