[ArchWall] Fix MakeBlocks to work if Base is Sketch with 1 edge only

To be merged with #4955
This commit is contained in:
paul lee
2021-08-09 09:06:03 +08:00
parent 64f4984a22
commit dc911dde55

View File

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