haplokuon / netDxf

.net dxf Reader-Writer
MIT License
984 stars 400 forks source link

AutoCad 2004 parse failure #221

Open RobGustavsson opened 3 years ago

RobGustavsson commented 3 years ago

Hello,

We have some problem reading a dxf file from one of our customers. If we convert the file using a dxf-converter the file works, but out of the box it does not.

I have tried using the latest on master and the latest nuget package.

The first error is on line 2661 in the file (seems to be an unexpected blank line).

image Utsättning 232.zip

haplokuon commented 3 years ago

This is the common mistake of a program writing an invalid value. The code 330 holds a handle and no program should not leave it empty, therefore if there is no referenced handle it should not write the code 330. If you audit that file in AutoCad it will show that an error was found, I am not sure if it refers to those 330 codes. Usually, error in handles ends up in a complete crash of AutoCad, luckily not this time. I will add a workaround that in a quick update.