Draft: fixed export of invalid shapes to DXF
This commit is contained in:
parent
ff2ccdd648
commit
1843f89659
|
@ -1815,9 +1815,11 @@ def export(objectslist,filename,nospline=False,lwPoly=False):
|
||||||
for ob in exportList:
|
for ob in exportList:
|
||||||
print("processing "+str(ob.Name))
|
print("processing "+str(ob.Name))
|
||||||
if ob.isDerivedFrom("Part::Feature"):
|
if ob.isDerivedFrom("Part::Feature"):
|
||||||
if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("dxfmesh"):
|
|
||||||
sh = None
|
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)
|
writeMesh(ob,dxf)
|
||||||
elif gui and FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("dxfproject"):
|
elif gui and FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("dxfproject"):
|
||||||
direction = FreeCADGui.ActiveDocument.ActiveView.\
|
direction = FreeCADGui.ActiveDocument.ActiveView.\
|
||||||
|
@ -1829,7 +1831,6 @@ def export(objectslist,filename,nospline=False,lwPoly=False):
|
||||||
else:
|
else:
|
||||||
sh = ob.Shape
|
sh = ob.Shape
|
||||||
if sh:
|
if sh:
|
||||||
if not sh.isNull():
|
|
||||||
if sh.ShapeType == 'Compound':
|
if sh.ShapeType == 'Compound':
|
||||||
if (len(sh.Wires) == 1):
|
if (len(sh.Wires) == 1):
|
||||||
# only one wire in this compound, no lone edge -> polyline
|
# only one wire in this compound, no lone edge -> polyline
|
||||||
|
|
Loading…
Reference in New Issue
Block a user