haplokuon / netDxf

.net dxf Reader-Writer
MIT License
995 stars 405 forks source link

Problems with DXFs after saving #291

Open Nagatino opened 3 years ago

Nagatino commented 3 years ago

DXFs.zip Hello! I use netDxf for a small application which helps translate strings in AutoCad files. Sometimes everything works fine. But some files have troubles after being saved. Bitmaps disappear, some strange lines appear, objects move. At first, I though that my actions caused those effects. But then I just loaded and re-saved DXFs using netDxf with the same effect. I attach a sample pair – original file and file re-saved straight after loading. Could you please help me understand the cause of the problem.

Thank you in advance.

haplokuon commented 3 years ago

The problem lies with the attribute definitions in a couple blocks that were created with the multiple lines option. They are not supported, it is very messy the way the DXF handles them, and I have no plans to implement it. The problematic blocks are "Info Commessa_1" and "Cartigli Cart. GE A2". I can avoid the problem raised by the DXF that uses the same code 41 for the "width factor" and "rectangle with", but, even then, It will mess up the text of the attributes.

This issue may not only produce the weird lines you are talking about but also the moved objects. I didn't see it in your samples.

About images disappearing I cannot tell you why, images in a DXF are externally linked and they must be accessible, read more about issues with images in a DXF here, specially my last post.