From fec3d96acc3404dce45ea970b24e68ecdb7a2ca9 Mon Sep 17 00:00:00 2001 From: Paul Lee Date: Fri, 16 May 2025 23:52:40 +0800 Subject: [PATCH] [ArchWall] Fix SetLength Error When Base Sketch has External Geom fix #21357 error message problem Github issue and discussion: https://github.com/FreeCAD/FreeCAD/issues/21357 https://github.com/FreeCAD/FreeCAD/issues/21357#issuecomment-2886010914 ArchWall return error when Base Sketch has external(projected) geometry. External projected geometry has TNP-problem, until the feature is TNP-tolerant, support of external(projected) geometry at ArchWall is not encouraged. The reported error message is fixed in the meantime in this PR. --- src/Mod/BIM/ArchWall.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/Mod/BIM/ArchWall.py b/src/Mod/BIM/ArchWall.py index 9388719549..067d7da978 100644 --- a/src/Mod/BIM/ArchWall.py +++ b/src/Mod/BIM/ArchWall.py @@ -547,20 +547,16 @@ class _Wall(ArchComponent.Component): obj.CountBroken = 0 # set the length property - if obj.Base: - if hasattr(obj.Base,'Shape'): - if obj.Base.Shape.Edges: - if not obj.Base.Shape.Faces: - if hasattr(obj.Base.Shape,"Length"): - l = float(0) - for e in self.connectEdges: - l += e.Length - l = l / 2 - if self.layersNum: - l = l / self.layersNum - if obj.Length.Value != l: - obj.Length = l - self.oldLength = None # delete the stored value to prevent triggering base change below + if self.connectEdges: + l = float(0) + for e in self.connectEdges: + l += e.Length + l = l / 2 + if self.layersNum: + l = l / self.layersNum + if obj.Length.Value != l: + obj.Length = l + self.oldLength = None # delete the stored value to prevent triggering base change below # set the Area property obj.Area = obj.Length.Value * obj.Height.Value