mozman / ezdxf

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

Invalid export of version- and lock_position tags in ATTDEF and ATTRIB #907

Closed mozman closed 1 year ago

mozman commented 1 year ago

When exporting files from AutoCAD Plant by ezdxf the exported file is an invalid DXF file for Autodesk Trueview 2023.

The issue was caused by the version- and lock_position tags, see post below.

The test file was provided by issue #906.

This is the copy by ezdxf: 906_copy.zip

The error message of Trueview is not helpful, can someone load the file "906_copy.dxf" by the RECOVER command of AutoCAD and post the output messages of the recover process?

BricsCAD has no problem to open the file copy and the RECOVER command of BricsCAD does not report any errors.

miiarantala commented 1 year ago

I tried using the RECOVER command for the "906_copy.dxf" file with AutoCAD 2024.

The recovery did not seem to complete, AutoCAD just shows "Press ENTER to continue" like this and then closes the drawing:

image

I attached the log file here: 906_copy_1c37dcc88.log

mozman commented 1 year ago

Thank you.

mozman commented 1 year ago

The version tag in ATTDEF and ATTRIB has the same group code (280) as the lock_position tag and the implementation required both to be present to work properly.

The new implementation uses the last occurrence of group code 280 as lock position tag. The version tag is always 0, so if lock_position is missing and the version tag is present, lock_position is set to 0, which is the default value.