forked from 1b-agent/opencadstudio-upstream
feat(dimstyle): block/linetype Handle cyclers for arrowheads & ext lines
The arrowhead-block (DIMBLK/DIMBLK1/DIMBLK2/DIMLDRBLK) and ext-line linetype (DIMLTYPE/DIMLTEX1/DIMLTEX2) Handle fields are now editable in the Dimension Style manager. Each shows the resolved block-record / linetype name and a Cycle button that advances through the available records (NULL = Default arrowhead / ByBlock linetype). Edits bump geometry so dimensions re-render with the new arrowheads/linetypes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
df44031ae8
commit
1b7edf6cae
4 files changed
+132
No files matched your search
@@ -234,6 +234,50 @@ impl OpenCADStudio {
|
||||
.iter()
|
||||
.map(|s| s.name.clone())
|
||||
.collect();
|
||||
let doc = &tab.scene.document;
|
||||
let blk_name = |h: acadrust::types::Handle| -> String {
|
||||
if h.is_null() {
|
||||
"Default".to_string()
|
||||
} else {
|
||||
doc.block_records
|
||||
.iter()
|
||||
.find(|b| b.handle == h)
|
||||
.map(|b| b.name.trim_start_matches('_').to_string())
|
||||
.unwrap_or_else(|| "?".to_string())
|
||||
}
|
||||
};
|
||||
let lt_name = |h: acadrust::types::Handle| -> String {
|
||||
if h.is_null() {
|
||||
"ByBlock".to_string()
|
||||
} else {
|
||||
doc.line_types
|
||||
.iter()
|
||||
.find(|lt| lt.handle == h)
|
||||
.map(|lt| lt.name.clone())
|
||||
.unwrap_or_else(|| "?".to_string())
|
||||
}
|
||||
};
|
||||
let ds_sel = doc.dim_styles.get(&self.dimstyle_selected);
|
||||
let (
|
||||
dimblk_name,
|
||||
dimblk1_name,
|
||||
dimblk2_name,
|
||||
dimldrblk_name,
|
||||
dimltex_name,
|
||||
dimltex1_name,
|
||||
dimltex2_name,
|
||||
) = match ds_sel {
|
||||
Some(d) => (
|
||||
blk_name(d.dimblk),
|
||||
blk_name(d.dimblk1),
|
||||
blk_name(d.dimblk2),
|
||||
blk_name(d.dimldrblk),
|
||||
lt_name(d.dimltex_handle),
|
||||
lt_name(d.dimltex1_handle),
|
||||
lt_name(d.dimltex2_handle),
|
||||
),
|
||||
None => Default::default(),
|
||||
};
|
||||
return crate::ui::dimstyle::view_window(
|
||||
styles,
|
||||
&self.dimstyle_selected,
|
||||
@@ -308,6 +352,13 @@ impl OpenCADStudio {
|
||||
dimalttz: &self.ds_dimalttz,
|
||||
dimtolj: &self.ds_dimtolj,
|
||||
dimtzin: &self.ds_dimtzin,
|
||||
dimblk_name,
|
||||
dimblk1_name,
|
||||
dimblk2_name,
|
||||
dimldrblk_name,
|
||||
dimltex_name,
|
||||
dimltex1_name,
|
||||
dimltex2_name,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user