forked from 1b-agent/opencadstudio-upstream
feat(blocks): edit action selections and refresh evaluated references
Add BACTIONSET and the Block Editor Action Selection ribbon entry. Pick or preselect an action, replace/add/remove its drawing targets, or redefine a Stretch frame while preserving the native action and graph identity. Retain existing Stretch vertex bindings during target edits and bind new targets against the stored frame. Allow removing invalid bindings or rebuilding them through a replacement frame. Rebuild evaluated references at their independent cached values so removed targets lose old action effects, with local undo, discard and one drawing save delta. Validate synthetic native DWG/DXF roundtrips, shared COPY representations, stale-result guards, reference geometry refresh, frame/cancel/history and the real ribbon flyout. 347 block tests pass (6 existing opt-in ignored), plus 42 dock and 27 viewport tests.
This commit is contained in:
1 parent
042f26a4cc
commit
7c91f5835e
15 files changed
+1083
-69
No files matched your search
@@ -391,6 +391,7 @@ impl OpenCADStudio {
|
||||
return Some(Task::none());
|
||||
}
|
||||
match cmd {
|
||||
"BACTIONSET" => Some(self.start_block_action_set()),
|
||||
cmd if cmd == "BACTION"
|
||||
|| cmd.starts_with("BACTION ")
|
||||
|| cmd == "BACTIONTOOL"
|
||||
|
||||
@@ -175,12 +175,18 @@ impl OpenCADStudio {
|
||||
};
|
||||
let resolved = self.resolve_alias(cmd);
|
||||
let cmd = resolved.as_deref().unwrap_or(cmd);
|
||||
if cmd == "BACTIONSET" {
|
||||
if let Some(error) = self.action_set_error() {
|
||||
self.command_line.push_error(crate::t!(error).as_ref());
|
||||
return Task::none();
|
||||
}
|
||||
}
|
||||
if matches!(cmd.split(' ').next(), Some("BACTION" | "BACTIONTOOL")) {
|
||||
let args = cmd.split_once(' ').map_or("", |(_, a)| a.trim());
|
||||
if !args.is_empty() && crate::scene::block_actions::Kind::parse(args).is_none() {
|
||||
self.command_line.push_error(
|
||||
crate::t!(
|
||||
"Supported actions: Move, Scale. Other action types are not wired yet."
|
||||
"Supported actions: Move, Scale, Stretch, Rotate, Flip. Other action types are not wired yet."
|
||||
)
|
||||
.as_ref(),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user