forked from 1b-agent/opencadstudio-upstream
fix(insert): ATTREQ 0 inserts attributes with their defaults, without prompting
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
785db5683b
commit
3ae2912558
1 file changed
+7
-1
@@ -984,7 +984,7 @@ impl OpenCADStudio {
|
||||
let i = self.active_tab;
|
||||
// Collect the full AttributeDefinitions owned by this block
|
||||
// record so each created attribute keeps its geometry (#255).
|
||||
let attdefs: Vec<codec::entities::AttributeDefinition> = {
|
||||
let mut attdefs: Vec<codec::entities::AttributeDefinition> = {
|
||||
let doc = &self.tabs[i].scene.document;
|
||||
if let Some(br) = doc.block_records.get(&block_name) {
|
||||
br.entity_handles
|
||||
@@ -1004,6 +1004,12 @@ impl OpenCADStudio {
|
||||
}
|
||||
};
|
||||
|
||||
// ATTREQ 0: attributes take their defaults without prompting.
|
||||
if !self.tabs[i].scene.document.header.attribute_request {
|
||||
for attdef in &mut attdefs {
|
||||
attdef.flags.preset = true;
|
||||
}
|
||||
}
|
||||
if attdefs.is_empty() {
|
||||
// No attribute definitions — commit the INSERT directly.
|
||||
let entity = self.tabs[i]
|
||||
|
||||
Reference in new issue
Block a user