Implement associative center mark workflow
This commit is contained in:
parent
0ae6355c2c
commit
ff09fc7800
18 changed files with 936 additions and 40 deletions
|
|
@ -1844,14 +1844,16 @@ impl OpenCADStudio {
|
|||
&mut entity,
|
||||
);
|
||||
|
||||
// Smart centre lines carry their own drawing-level creation style.
|
||||
// Smart centre objects carry their own drawing-level creation style.
|
||||
// Apply it after the generic ribbon style so ordinary LINE entities
|
||||
// keep the existing path while centre lines honour their settings.
|
||||
if acadrust::entities::CenterLineAssociation::read(
|
||||
let center_line = acadrust::entities::CenterLineAssociation::read(
|
||||
&entity.common().extended_data,
|
||||
)
|
||||
.is_some()
|
||||
{
|
||||
).is_some();
|
||||
let center_mark = acadrust::entities::CenterMarkAssociation::read(
|
||||
&entity.common().extended_data,
|
||||
).is_some();
|
||||
if center_line || center_mark {
|
||||
let settings = self.tabs[i].scene.centerline_settings();
|
||||
if !settings.layer.eq_ignore_ascii_case("Current") {
|
||||
entity.common_mut().layer = settings.layer;
|
||||
|
|
@ -1860,15 +1862,18 @@ impl OpenCADStudio {
|
|||
entity.common_mut().linetype = settings.linetype;
|
||||
}
|
||||
entity.common_mut().linetype_scale = settings.linetype_scale;
|
||||
let application = if center_mark {
|
||||
acadrust::entities::CENTERMARK_XDATA_APPLICATION
|
||||
} else {
|
||||
acadrust::entities::CENTERLINE_XDATA_APPLICATION
|
||||
};
|
||||
if !self.tabs[i]
|
||||
.scene
|
||||
.document
|
||||
.app_ids
|
||||
.contains(acadrust::entities::CENTERLINE_XDATA_APPLICATION)
|
||||
.contains(application)
|
||||
{
|
||||
let mut app = acadrust::tables::AppId::new(
|
||||
acadrust::entities::CENTERLINE_XDATA_APPLICATION,
|
||||
);
|
||||
let mut app = acadrust::tables::AppId::new(application);
|
||||
app.handle = self.tabs[i].scene.document.allocate_handle();
|
||||
let _ = self.tabs[i].scene.document.app_ids.add(app);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue