Draft: fixed export of invalid shapes to DXF

This commit is contained in:
Yorik van Havre 2016-08-28 14:18:12 -03:00
parent ff2ccdd648
commit 1843f89659

View File

@ -1815,9 +1815,11 @@ def export(objectslist,filename,nospline=False,lwPoly=False):
for ob in exportList:
print("processing "+str(ob.Name))
if ob.isDerivedFrom("Part::Feature"):
if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("dxfmesh"):
sh = None
if not ob.Shape.isNull():
if ob.Shape.isNull():
print ("Null shape - skipping")
continue
elif FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("dxfmesh"):
writeMesh(ob,dxf)
elif gui and FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("dxfproject"):
direction = FreeCADGui.ActiveDocument.ActiveView.\
@ -1829,7 +1831,6 @@ def export(objectslist,filename,nospline=False,lwPoly=False):
else:
sh = ob.Shape
if sh:
if not sh.isNull():
if sh.ShapeType == 'Compound':
if (len(sh.Wires) == 1):
# only one wire in this compound, no lone edge -> polyline