mozman / ezdxf

Python interface to DXF
https://ezdxf.mozman.at
MIT License
927 stars 190 forks source link

loading and writing a DXF modifies it (and breaks converters). #1

Closed lc-thomas closed 7 years ago

lc-thomas commented 7 years ago

Say I convert my dxf to a png, using libre office :

subprocess.call(['libreoffice', '--headless', '--convert-to', 'png', 'PFI350-3.dxf']) I get a nice image.

But, and just by cloning the file :

dxf = ezdxf.readfile('PC-PFI-300-406.dxf')
ts = time.time()
dxf.saveas('%s.dxf' % ts)
subprocess.call(['libreoffice', '--headless', '--convert-to', 'png', '%s.dxf' % ts])

I get a white image.

Any ideas why?

Also if using libreoffice I convert the dxf to an svg, and then edit the file, I can clearly see that there is almost nothing in it. where did all the objects go?

mozman commented 7 years ago

It is not possible to do a diagnose without your DXF file, but I assume, your DXF file is an old DXF format, which means it is older than R12 or equals R13/R14 (formats even AutoCAD do not write anymore). ezdxf tries to 'upgrade' this DXF versions to the next supported format (pre R12 -> R12 and R13/R14-> R2000), but this process is not perfect because ezdxf was never meant to be a DXF converter.

mozman commented 7 years ago

Found a bug, which causes a data loss if model space is called *MODEL_SPACE, fixed in release v0.7.9, maybe this fixes your problem, a feedback would be nice.