Version >= 0.27.1 writes DXF with AC1014

Version <= 0.27.0 writes DXF with AutoCAD version as AC1006, but recent versions writes as AC1014 instead.

I tested DXF files written by Klayout with version before and after 0.27.0 using Autodesk Viewer web site.
AC1014 DXF files result in errors, while AC1006 files are OK.

Comments

  • Yes, this dates back to this request: https://github.com/KLayout/klayout/issues/796

    Maybe this time you would like to propose a version?

    Matthias

  • Oh I see. Thanks for clarification. I have no expertise to propose a version.

    Before writing the above post, I tested like this. Using KLayout 0.27.1, I created a very simple drawing with a single box and saved it with 5 different options (POLYLINE, LWPOLYLINE, SOLID, HATCH, LINE). And I opened generated DXF files and changed AC1024 -> AC1006. These 10 sample DXF files were then uploaded to Autodesk Viewer web sites and results are;

    AC1024 + POLYLINE = FAIL
    AC1024 + LWPOLYLINE = FAIL
    AC1024 + SOLID = FAIL
    AC1024 + HATCH = FAIL
    AC1024 + LINE = FAIL

    AC1006 + POLYLINE = SUCCESS
    AC1006 + LWPOLYLINE = FAIL
    AC1006 + SOLID = SUCCESS
    AC1006 + HATCH = FAIL
    AC1006 + LINE = FAIL

    So, I edited KLayout dbDXFWriter.cc from AC1024 to AC1006 and built KLayout, which works well with my usage scenario.

  • I would suggest that the default version be something
    more toward the "trailing edge" so that other tools and
    older versions can have a chance of working. What is
    the value of following Autodesk's deliberate version-
    churning too closely? Especially when users with current
    licenses can (I expect?) save-as the older format?

    In fact the best guidance might be to use the second-
    oldest save-as-able, no-special-effort readable, version
    you see in current release "File" functions menu.

    Of course sooner or later that will become what's
    now under discussion. I think there should always
    be the option to select the last-known-good version
    along with the latest_greatest_if_only version.

  • edited July 13

    Thanks for these inputs. I'm more worried about the triple fails even for AC1006. @yangwoo is there a chance you can share your test cases?

    I'm trying to avoid online viewers because I think first of all they want your data and their implementation is a mystery. My reference is AutoDesk TrueView, the SolidWorks viewer and some non-CAD tools (InkScape, Blender). So far I was able to read KLayout-generated DXF files in most flavours. But DXF is an ongoing adventure. Unfortunately, most of the tools do not provide any useful error output.

    I'm not trying to build the perfect DXF writer - my own understanding is quite limited with respect to DXF. So more details are appreciated.

    Matthias

  • I will request our developers to check whether their tools (probably a little old version of AutoCAD) can handle my sample DXF files. Then share results as well as files.

  • Unfortunately, CAD programs used in our company also show poor results. (Sample files used are attached.)

    • AutoCAD LT 2012 / AutoCAD 2015

    AC1024 + POLYLINE = FAIL
    AC1024 + LWPOLYLINE = FAIL
    AC1024 + SOLID = FAIL
    AC1024 + HATCH = FAIL
    AC1024 + LINE = FAIL

    AC1006 + POLYLINE = SUCCESS
    AC1006 + LWPOLYLINE = FAIL
    AC1006 + SOLID = SUCCESS
    AC1006 + HATCH = FAIL
    AC1006 + LINE = FAIL

    • GStarCAD 2017 / GStartCAD 2020 (derivative of IntelliCAD)

    AC1024 + POLYLINE = FAIL
    AC1024 + LWPOLYLINE = FAIL
    AC1024 + SOLID = FAIL
    AC1024 + HATCH = FAIL
    AC1024 + LINE = FAIL

    AC1006 + POLYLINE = SUCCESS
    AC1006 + LWPOLYLINE = SUCCESS
    AC1006 + SOLID = SUCCESS
    AC1006 + HATCH = SUCCESS (but no object is shown)
    AC1006 + LINE = SUCCESS

  • edited July 22

    @yangwoo Thanks for this information. I have conducted some experiments with AutoDesk DWG TrueView. This tool can read AC1006 version DXF files produced by KLayout in all cases except SOLID, but not read AC1024 version.

    Some experimental debugging of working sample files indicates that the tools expects some metadata (tables and header properties), but without more insight into the DXF structure I cannot provide this information. I have decided to revert back to AC1006 and my recommendation is to use POLYLINE which seems to work in most cases.

    If someone could explain to me the elements required for a minimum viable DXF file I'm willing to implement these. But this kind of trial-and-error debugging is too tedious and painful. I know the specification but I assume it's intentionally kept sparse. I was not able to deduce useful information about the meta data structure.

    The primary goal of the DXF writer is to supply some minimum interface to open source tools accepting DXF as a graphical exchange format (e.g. Blender). As I can read their sources, I'm able to support the DXF flavour they accept. My intention was never to support an interface towards AutoCAD.

    Thanks and best regards,

    Matthias

  • Always, thanks for your hard work. I totally agree with you the last statement.

Sign In or Register to comment.