Merge pull request #865 from schoeller/panel-xdata
feat(properties): show XDATA records in Properties panel
This commit is contained in:
commit
1fb770fb15
3 changed files with 27 additions and 0 deletions
|
|
@ -2573,6 +2573,7 @@ properties =
|
|||
.ext-line-lineweight = Ext line lineweight
|
||||
.ext-line-offset = Ext line offset
|
||||
.extended-entity = Extended Entity
|
||||
.extended-data = Extended Data
|
||||
.extended-lighting = Extended Lighting
|
||||
.extents-max = Extents Max
|
||||
.extents-min = Extents Min
|
||||
|
|
|
|||
|
|
@ -671,6 +671,31 @@ impl OpenCADStudio {
|
|||
entity,
|
||||
));
|
||||
|
||||
{
|
||||
use crate::entities::common::ro_prop;
|
||||
let xd = &source_entity.common().extended_data;
|
||||
if !xd.is_empty() {
|
||||
let mut xd_props = Vec::new();
|
||||
for rec in xd.records() {
|
||||
let value_text = rec
|
||||
.values
|
||||
.iter()
|
||||
.map(|value| format!("{value:?}"))
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ");
|
||||
xd_props.push(ro_prop(
|
||||
t!("Application").as_ref(),
|
||||
"xdata_value",
|
||||
format!("{}: {value_text}", rec.application_name),
|
||||
));
|
||||
}
|
||||
sections.push(crate::scene::model::object::PropSection {
|
||||
title: t!("Extended Data").into_owned(),
|
||||
props: xd_props,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Uniform-scale checkbox for block references (#427):
|
||||
// while the three scale factors are equal (and the user
|
||||
// hasn't opted into per-axis editing) the panel shows one
|
||||
|
|
|
|||
|
|
@ -1015,6 +1015,7 @@ pub(super) fn message_attribute(source: &str) -> Option<(&'static str, &'static
|
|||
"Ext line offset" => Some(("properties", "ext-line-offset")),
|
||||
"Ext line weight (DIMLWE)" => Some(("draw", "ext-line-weight-dimlwe")),
|
||||
"Extend" => Some(("modify", "extend")),
|
||||
"Extended Data" => Some(("properties", "extended-data")),
|
||||
"Extended Entity" => Some(("properties", "extended-entity")),
|
||||
"Extended Lighting" => Some(("properties", "extended-lighting")),
|
||||
"Extension" => Some(("common", "extension")),
|
||||
|
|
|
|||
Loading…
Reference in a new issue