DomCR / ACadSharp

C# library to read/write cad files like dxf/dwg.
MIT License
416 stars 117 forks source link

Error converting from DWG to DXF #153

Closed xaotix closed 1 year ago

xaotix commented 1 year ago

Describe the bug I'm trying to convert a DWG 2010 to DXF. But the file saved is corrupted.

To Reproduce

       var doc = new DwgReader("test.dwg").Read();
        var writer = new DxfWriter($"test.dxf", doc, false);
        writer.Write();

Screenshots image

Additional context test.zip

DomCR commented 1 year ago

Hi @xaotix,

I've tested your file, it seems that the refactor for the CadHeader writes some variables that are invalid for some versions. I'll open a branch to fix this issue and find a better solution to write the header.