Arch: fixed remaining bugs in structures + use facemakers - fixes #2523

This commit is contained in:
Yorik van Havre 2016-11-12 11:48:05 -02:00
parent 9683babcc8
commit 1537ecf9e4

View File

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