haplokuon / netDxf

.net dxf Reader-Writer
MIT License
966 stars 393 forks source link

Doesn't list the Attributes of the file #477

Closed xaotix closed 10 months ago

xaotix commented 10 months ago

block.zip

When I try to load the file attached who is a block, the table of attributes doesn't come. How to proceed?

var dxf = DxfDocument.Load(file);

image

haplokuon commented 10 months ago

You have attribute definitions at the document level. You can access them with doc.Layouts[Layout.ModelSpace].AssociatedBlock.AttributeDefinitions; doc.Blocks[Block.ModelSpace].AttributeDefinitions; both ways will point you to the same place.

Just in case, read this and this about how they are implemented in this library, attributes and attribute definitions have their place, I do not consider them as entities. I hate how they are implemented and I needed to take compromises.