- fixed issue when exporting DXF and not settings the units

- added the posibility to export the Geometry in different DXF formats (previously it was hard coded to the AutoCAD 2010): R12, R2000, R2004, R2007, R2010, R2013, R2018
- fixed the camlib.Geometry.bounds() method such that it is calculated correctly for Geometry objects created in the Geometry Editor
This commit is contained in:
Marius Stanciu
2021-03-11 04:50:41 +02:00
committed by Marius
parent d464c1e18a
commit 2f57e97a21
7 changed files with 82 additions and 6 deletions

View File

@@ -1963,10 +1963,16 @@ class GeometryObject(FlatCAMObj, Geometry):
def export_dxf(self):
dwg = None
dxf_format = self.app.defaults['geometry_dxf_format']
try:
dwg = ezdxf.new('R2010')
dwg = ezdxf.new(dxf_format)
msp = dwg.modelspace()
# add units
dwg.units = ezdxf.InsertUnits(4) if self.app.defaults['units'].lower() == 'mm' else ezdxf.InsertUnits(1)
dwg.header['$MEASUREMENT'] = 1 if self.app.defaults['units'].lower() == 'mm' else 0
def g2dxf(dxf_space, geo_obj):
if isinstance(geo_obj, MultiPolygon):
for poly in geo_obj: