From 1523eda00f394932b87ac5b5d1566f4b7242b19d Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Fri, 3 Jul 2026 00:17:58 +0300 Subject: [PATCH] feat(properties): fill solid-history + viewport clipped rows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bump acadrust to ef0e231 (region/body history handle + viewport clip boundary now stored) and populate the rows the builders left blank: - Solid3D / Body "Show History": derived from the history handle's presence (there is no separate stored bool — the DWG carries only the H 350 history link). - Body "History": the history handle, matching how Solid3D already shows it. - Viewport "Clipped": Yes when the clip-boundary handle is non-NULL. Hatch Origin X/Y and Boundary retention stay blank by design: they are not part of the persisted AcDbHatch record in DWG or DXF (retention is a BHATCH command setting), so there is nothing to read. Co-Authored-By: Claude Opus 4.8 --- Cargo.lock | 2 +- src/entities/solid3d.rs | 28 ++++++++++++++++++++++------ src/entities/viewport.rs | 6 +++++- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 246bf0d0f..3987a12c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -71,7 +71,7 @@ checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" [[package]] name = "acadrust" version = "0.4.0" -source = "git+https://github.com/HakanSeven12/acadrust?branch=main#a46cb8b3a2e5523bbd28e5afa0f8efb7ae291c50" +source = "git+https://github.com/HakanSeven12/acadrust?branch=main#ef0e2310c3b2449cf28f8da02c22b831cdc4a50b" dependencies = [ "ahash 0.8.12", "anyhow", diff --git a/src/entities/solid3d.rs b/src/entities/solid3d.rs index d696f3149..059340e7d 100644 --- a/src/entities/solid3d.rs +++ b/src/entities/solid3d.rs @@ -107,16 +107,22 @@ impl Grippable for Solid3D { impl PropertyEditable for Solid3D { fn geometry_properties(&self, _text_style_names: &[String]) -> Vec { - let history = match self.history_handle { - Some(h) if !h.is_null() => format!("{:X}", h.value()), - _ => "None".to_string(), + let has_history = matches!(self.history_handle, Some(h) if !h.is_null()); + let history = if has_history { + format!("{:X}", self.history_handle.unwrap().value()) + } else { + "None".to_string() }; vec![ PropSection { title: "Solid History".into(), props: vec![ ro("History", "s3d_history", history), - ro("Show History", "s3d_show_history", String::new()), + ro( + "Show History", + "s3d_show_history", + if has_history { "Yes" } else { "No" }, + ), ], }, PropSection { @@ -200,11 +206,21 @@ impl Grippable for Body { impl PropertyEditable for Body { fn geometry_properties(&self, _text_style_names: &[String]) -> Vec { + let has_history = matches!(self.history_handle, Some(h) if !h.is_null()); + let history = if has_history { + format!("{:X}", self.history_handle.unwrap().value()) + } else { + "None".to_string() + }; vec![PropSection { title: "Solid History".into(), props: vec![ - ro("History", "bdy_history", String::new()), - ro("Show History", "bdy_show_history", String::new()), + ro("History", "bdy_history", history), + ro( + "Show History", + "bdy_show_history", + if has_history { "Yes" } else { "No" }, + ), ], }] } diff --git a/src/entities/viewport.rs b/src/entities/viewport.rs index 3ca8bf72e..a0873ba1d 100644 --- a/src/entities/viewport.rs +++ b/src/entities/viewport.rs @@ -129,7 +129,11 @@ fn properties(vp: &Viewport) -> Vec { value: vp.status.is_on, }, }, - ro("Clipped", "vp_clipped", String::new()), + ro( + "Clipped", + "vp_clipped", + if vp.clip_boundary_handle.is_null() { "No" } else { "Yes" }, + ), Property { label: "Display locked".into(), field: "vp_locked",