forked from 1b-agent/opencadstudio-upstream
fix(insert): place block attributes by their ATTDEF geometry, follow the block (#255)
Inserting a block piled every attribute at the origin: each AttributeEntity was built from just tag + value with default geometry. Carry the full AttributeDefinition through the attreq flow and build attributes with AttributeEntity::from_definition, then apply the block's insertion transform so each lands in WCS at its proper position / alignment / rotation. Attributes are stored in world space, so moving the block must move them too. The MOVE command already did (acadrust translate_insert); apply_grip (grip-drag) and the Position X/Y/Z property edit now translate the attributes by the same world delta so they no longer stay behind. Rotate/scale/mirror of a block still don't carry the attributes — acadrust's transform_insert has no attribute pass — tracked separately. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
818638d3aa
commit
ab0a4f790c
4 files changed
+60
-40
No files matched your search
+4
-3
@@ -673,9 +673,10 @@ pub trait CadCommand: Send {
|
||||
None
|
||||
}
|
||||
|
||||
/// Inject attribute definitions (tag, prompt, default_value) for ATTREQ
|
||||
/// attr-filling after INSERT point is picked.
|
||||
fn attreq_set_attdefs(&mut self, _attdefs: Vec<(String, String, String)>) {}
|
||||
/// Inject the block's attribute definitions for ATTREQ attr-filling after
|
||||
/// the INSERT point is picked. Carries the full definitions so the created
|
||||
/// attributes inherit their geometry, not just tag / prompt / default (#255).
|
||||
fn attreq_set_attdefs(&mut self, _attdefs: Vec<acadrust::entities::AttributeDefinition>) {}
|
||||
|
||||
/// Returns the INSERT entity built so far (pending attr fill) if this is an
|
||||
/// ATTREQ-aware INSERT command waiting for attdef injection.
|
||||
|
||||
Reference in new issue
Block a user