Block Attribute Manager window (BATTMAN / ATTMAN)

BATTMAN and ATTMAN open a manager for the attribute definitions of one
attributed block: block chips with reference counts and a pick button,
a table whose columns are chosen with chips, move up/down, remove, and
an edit card (Attribute / Text / Properties) for the selected row. Apply,
OK and Sync write the list back to the block definition and, when asked,
rebuild the existing references keeping values through tag renames;
each is one undo step. Live changes are taken back on Cancel. Automation
gains attman_dialog.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-10-15 10:10:54 +03:00
1 parent 39c3e9af58
commit 4726c775bf
35 files changed
+2083 -6

No files matched your search

+41
View File
@@ -8,3 +8,44 @@ pub fn tool() -> ToolDef {
event: ModuleEvent::Command("ATTMAN".to_string()),
}
}
/// The Block Attribute Manager's "Select block" button: one block reference
/// picked in the drawing, handed back as `_ATTMAN_PICK <hex handle>`.
pub struct AttmanPickCommand;
impl crate::command::CadCommand for AttmanPickCommand {
fn name(&self) -> &'static str {
"BATTMAN"
}
fn prompt(&self) -> String {
"Select a block:".into()
}
fn needs_entity_pick(&self) -> bool {
true
}
fn entity_pick_highlights_hover(&self) -> bool {
true
}
fn on_entity_pick(&mut self, handle: codec::Handle, _pt: glam::DVec3) -> crate::command::CmdResult {
if handle.is_null() {
return crate::command::CmdResult::NeedPoint;
}
crate::command::CmdResult::Dispatch(format!("_ATTMAN_PICK {:X}", handle.value()))
}
fn on_point(&mut self, _pt: glam::DVec3) -> crate::command::CmdResult {
crate::command::CmdResult::NeedPoint
}
fn on_enter(&mut self) -> crate::command::CmdResult {
crate::command::CmdResult::Dispatch("_ATTMAN_PICK".into())
}
fn on_escape(&mut self) -> crate::command::CmdResult {
crate::command::CmdResult::Dispatch("_ATTMAN_PICK".into())
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
mod attdef;
pub(crate) mod attedit;
mod attman;
pub(crate) mod attman;
pub mod base_point;
pub(crate) mod block_cmdline;
mod content_browser;