Closed markkonst closed 4 years ago
This kind of errors in a DXF are unacceptable, you cannot write a random string where an hexadecimal number is expected and hope it will work. This is a serious bug in the program that created the DXF. And as I wrote in a few occasions you need to be very careful with the handles in a DXF, errors with them usually ends with a complete crash with AutoCad. Your file will crash AutoCad when loaded, if it is because of that or there is something else, I don't know.
And please try to avoid posting a pull request for such small fixes, just open a new issue. In your case returning "0" under an error circumstance is wrong, I reserved the handle "0" for the document you should have returned null or an empty string instead.
Daniel,
I agree, such a workaround is ugly, but I needed it to get it working. I was hoping you could implement something like this so I can use the Nuget package instead of my own build. I will contact the party that exports this file.
Thanks for your reply.
Van: Daniel Carvajal notifications@github.com Verzonden: zondag 1 november 2020 16:23 Aan: haplokuon/netDxf netDxf@noreply.github.com CC: markkonst markkonst@controlspoint.com; Author author@noreply.github.com Onderwerp: Re: [haplokuon/netDxf] ReadHex could not read a non-numerical string. (#226)
This kind of errors in a DXF are unacceptable, you cannot write a random string where an hexadecimal number is expected and hope it will work. This is a serious bug in the program that created the DXF. And as I wrote in a few occasions you need to be very careful with the handles in a DXF, errors with them usually ends with a complete crash with AutoCad. Your file will crash AutoCad when loaded, if it is because of that or there is something else, I don't know.
And please try to avoid posting a pull request for such small fixes, just open a new issue. In your case returning "0" under an error circumstance is wrong, I reserved the handle "0" for the document you should have returned null or an empty string instead.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/haplokuon/netDxf/pull/226#issuecomment-720105179 , or unsubscribe https://github.com/notifications/unsubscribe-auth/APIL543AFKL55FAYP4SIQ7LSNV4PBANCNFSM4TAVLGIA . https://github.com/notifications/beacon/APIL546X22PJ726FZVCGDOTSNV4PBA5CNFSM4TAVLGIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFLV65WY.gif
ReadHex could not read a non-numerical string. Maybe faulty dxf file? But now it returns "0" on error.
Please note that I've attached a test file which will trigger this.
Tool.zip