This project has moved and is read-only. For the latest updates, please go here.

Spaces in attribute tags

May 26, 2016 at 12:19 PM
I am trying to load a dxf with spaces in the block attribute tags, which will not load with netDxf. I know this is not valid dxf according to the specification, but it seems that some editors (I think TurboCad and Draftsight, for example) are relaxed about this and will save dxf with spaces in block attribute tags.

I know it's good to be strict with the interpretation of the specification, but I wonder if it might be better to remove the exception for spaces in attribute tags?
May 27, 2016 at 6:55 PM
Edited May 27, 2016 at 9:04 PM
When I find any discrepancies between what the dxf documentation says and what some program actually does. I test how AutoCad handles it, since they are the ones that establish the rules.

The case you present is quite funny. As you already know the documentation clearly says that an attribute definition tag cannot contains spaces, but if you try to load a file with them with AutoCad, at least with the version I made the tests, it loads them just fine, it does not even delete the spaces and it shows the tag perfectly fine in the UI. Even when you save such a file it maintains the spaces. It is only when you try to add an attribute definition to a block that, it does not allow to create it with a tag containing spaces. Why it behaves like that, I really have no idea, perhaps is an old remnant of old versions, but it does not make any sense.

In conclusion, I will just delete that restriction in the AttributeDefinition class constructor, that's all you need to do to fix the problem.