You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CAD: choose the DWG/DXF version to write (e.g. AutoCAD 2013) #489
From discussion #483: save DWG/DXF in an older AutoCAD version, e.g. a 2026 drawing as 2013, so older AutoCAD/CAD programs can open it.
Today every DWG and DXF Filee writes is AutoCAD 2018 (AC1032), see CadFile.OutputVersion in src/Filee.Engines/Cad/CadFile.cs.
Idea:
A version choice on the CAD presets (DWG → DWG, DXF → DXF, DWG ↔ DXF): 2018 (default), 2013, 2010, 2007, 2004, 2000 — limited to the versions ACadSharp can write; check which ones round-trip.
DXF below 2007 isn't UTF-8: Korean/Chinese text needs the drawing's code page ($DWGCODEPAGE), so check that text survives.
Entities the older version doesn't have should be dropped or simplified with a clear note, not fail the whole file.
@KnifeLemon Happy to take this one if you'd like to assign it to us. It fits the CAD work in #471.
The plan: one option on CAD presets, DWG/DXF version (Same as the source, AutoCAD 2018, 2013, 2010, 2007, 2004 or 2000), passed to ACadSharp's writer. ACadSharp is already in Filee, so nothing new is added. We'd also add a test that reads each written version back.
Thanks @cre8ive-marketing, it's yours! The plan looks right. Two things I checked in ACadSharp 3.8.0 (the version Filee ships) that the PR should handle:
DWG 2007 can't be written.DwgWriter throws CadNotSupportedException for AC1021; R14, 2000, 2004, 2010, 2013 and 2018 work, and DXF works for all of them. So either leave 2007 out of the DWG choices or write 2004 for it, and decide what "Same as the source" does for a 2007 DWG (2010 seems the natural choice).
Text in versions before 2007. R14/2000/2004 store text in the drawing's code page ($DWGCODEPAGE), not UTF-8, and ACadSharp encodes with that code page as is, without \U+XXXX escapes. A 2018 drawing with Korean or Chinese text often still says ANSI_1252, so saving it as 2004 would turn the text into ?. Please pick the code page from the text when writing an older version (ANSI_949 Korean, 936 Simplified Chinese, 950 Traditional Chinese, 932 Japanese …) and write any character the code page can't hold as \U+XXXX, so mixed scripts survive too.
For the tests: besides reading each written version back, include a drawing with Korean and Chinese text saved as 2000/2004 and check the text comes back unchanged.
Version choice on DWG/DXF presets: 2018 (default), 2013, 2010, 2007, 2004, 2000, or the source's own. DWG → DWG and DXF → DXF are routes now.
DWG 2007: chosen, it's written as 2004, which AutoCAD 2007 opens. Kept from a 2007 source, it's written as 2010, as you suggested.
Code page: for 2004 and older, it's picked from the text (ANSI_949, 936, 950, 932 …), and anything that page can't hold is written as \U+XXXX. One finding: ACadSharp 3.8 doesn't know the name ANSI_949 (it writes UTF-8 / 1252), so Korean is encoded through KCS5601 and the DXF header is renamed to ANSI_949 after writing.
Newer objects (tables and arc dimensions before 2004, multileaders and PDF underlays before 2007, meshes before 2010) are left out with a note instead of failing the file.
Tests: every version × DWG/DXF reads back with its entities, and Korean, Chinese and mixed text come back unchanged at 2000 and 2004.
Update: Filee 2.1.0 is out with #497. DWG and DXF presets have a version choice (2018, 2013, 2010, 2007, 2004, 2000, or the source's own). Update from About → Check now.
Activity
cre8ive-marketing commentedon Oct 23, 2026
@KnifeLemon Happy to take this one if you'd like to assign it to us. It fits the CAD work in #471.
The plan: one option on CAD presets, DWG/DXF version (Same as the source, AutoCAD 2018, 2013, 2010, 2007, 2004 or 2000), passed to ACadSharp's writer. ACadSharp is already in Filee, so nothing new is added. We'd also add a test that reads each written version back.
KnifeLemon commentedon Oct 23, 2026
Thanks @cre8ive-marketing, it's yours! The plan looks right. Two things I checked in ACadSharp 3.8.0 (the version Filee ships) that the PR should handle:
DwgWriterthrowsCadNotSupportedExceptionfor AC1021; R14, 2000, 2004, 2010, 2013 and 2018 work, and DXF works for all of them. So either leave 2007 out of the DWG choices or write 2004 for it, and decide what "Same as the source" does for a 2007 DWG (2010 seems the natural choice).$DWGCODEPAGE), not UTF-8, and ACadSharp encodes with that code page as is, without\U+XXXXescapes. A 2018 drawing with Korean or Chinese text often still saysANSI_1252, so saving it as 2004 would turn the text into?. Please pick the code page from the text when writing an older version (ANSI_949 Korean, 936 Simplified Chinese, 950 Traditional Chinese, 932 Japanese …) and write any character the code page can't hold as\U+XXXX, so mixed scripts survive too.For the tests: besides reading each written version back, include a drawing with Korean and Chinese text saved as 2000/2004 and check the text comes back unchanged.
cre8ive-marketing commentedon Oct 23, 2026
@KnifeLemon #497 adds this. It isn't released yet.
\U+XXXX. One finding: ACadSharp 3.8 doesn't know the nameANSI_949(it writes UTF-8 / 1252), so Korean is encoded throughKCS5601and the DXF header is renamed toANSI_949after writing.CAD: choose the AutoCAD version to write DWG and DXF in (#489)
Merge pull request #497 from cre8ive-marketing/feature/489-cad-version
cre8ive-marketing commentedon Oct 25, 2026
Update: Filee 2.1.0 is out with #497. DWG and DXF presets have a version choice (2018, 2013, 2010, 2007, 2004, 2000, or the source's own). Update from About → Check now.