From dc911dde55ac2cf898c54f729a2df9e12cc28156 Mon Sep 17 00:00:00 2001 From: paul lee Date: Mon, 9 Aug 2021 09:06:03 +0800 Subject: [PATCH] [ArchWall] Fix MakeBlocks to work if Base is Sketch with 1 edge only To be merged with #4955 --- src/Mod/Arch/ArchWall.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Mod/Arch/ArchWall.py b/src/Mod/Arch/ArchWall.py index 4e4a37ef04..1feef163a3 100644 --- a/src/Mod/Arch/ArchWall.py +++ b/src/Mod/Arch/ArchWall.py @@ -850,7 +850,17 @@ class _Wall(ArchComponent.Component): offset = obj.OffsetFirst.Value else: offset = obj.OffsetSecond.Value - for edge in self.basewires[0].Edges: + # only 1 wire (first) is supported + if len(obj.Base.Shape.Edges) == 1: + # If there is a single edge, the wire was used + baseEdges = self.basewires[0].Edges + elif obj.Base.isDerivedFrom("Sketcher::SketchObject"): + # if obj.Base is Sketch, self.baseWires[0] returned is already a list of edge + baseEdges = self.basewires[0] + else: + # otherwise, it is wire + baseEdges = self.basewires[0].Edges + for edge in baseEdges: while offset < (edge.Length-obj.Joint.Value): #print i," Edge ",edge," : ",edge.Length," - ",offset if offset: