From 1537ecf9e4bace85c751094f132d36d4ca9319cb Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Sat, 12 Nov 2016 11:48:05 -0200 Subject: [PATCH] Arch: fixed remaining bugs in structures + use facemakers - fixes #2523 --- src/Mod/Arch/ArchStructure.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Mod/Arch/ArchStructure.py b/src/Mod/Arch/ArchStructure.py index 310c0512a..1d0ebd044 100644 --- a/src/Mod/Arch/ArchStructure.py +++ b/src/Mod/Arch/ArchStructure.py @@ -480,6 +480,8 @@ class _Structure(ArchComponent.Component): except: FreeCAD.Console.PrintError(translate("Arch","Facemaker returned an error")+"\n") return None + if len(baseface.Faces) > 1: + baseface = baseface.Faces[0] normal = baseface.normalAt(0,0) if not baseface: for w in obj.Base.Shape.Wires: @@ -540,8 +542,9 @@ class _Structure(ArchComponent.Component): if obj.Tool: nodes = obj.Tool.Shape elif extdata[1].Length > 0: - import Part - nodes = Part.Line(nodes.CenterOfMass,nodes.CenterOfMass.add(extdata[1])).toShape() + if hasattr(nodes,"CenterOfMass"): + import Part + nodes = Part.Line(nodes.CenterOfMass,nodes.CenterOfMass.add(extdata[1])).toShape() offset = FreeCAD.Vector() if hasattr(obj,"NodesOffset"): offset = FreeCAD.Vector(0,0,obj.NodesOffset.Value)