[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.
This commit is contained in:
Paul Lee
2025-05-16 23:52:40 +08:00
committed by Yorik van Havre
parent 4e95213e0a
commit fec3d96acc

View File

@@ -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