Adding Attribute Definitions to Just a Drawing?

Adding Attribute Definitions to Just a Drawing?

TCARPENTER21
Enthusiast Enthusiast
537 Views
2 Replies
Message 1 of 3

Adding Attribute Definitions to Just a Drawing?

TCARPENTER21
Enthusiast
Enthusiast

So I know how to add Attributes to an existing block, but I can't seem to figure out how to add them to just a drawing.  My code executes with no errors, I just don't get any attributes showing in the drawing...

 

I was hoping not to have to create a nested block, can I do this?  I'm using C# to create my code.

 

Thanks for any help.

0 Likes
Accepted solutions (1)
538 Views
2 Replies
Replies (2)
Message 2 of 3

TCARPENTER21
Enthusiast
Enthusiast
Accepted solution

I hate answering my own questions....  Once I updated the Block table record, they all appeared - thought was supposed to be an actual block in there - duh...

 

Thanks anyone who looked.

0 Likes
Message 3 of 3

norman.yuan
Mentor
Mentor

Attibute definition is meant to be added into a block definition (BlockTableRecord), not to a drawing. No, you cannot add attribute definition to a drawing, but you can add it to ModelSpace/PaperSpace (they are BlockTableRecord, after all), but it does not make much sense.

 

Maybe, you mean after adding an attribute definition to a block DEFINITION, you want al the block refernces to this definition also shows the corresponding attribute references. Well, in that case, you need deep understanding the relationships between block definition/reference and attribute definition/reference and write code to coorected updated the block referneces to the block definition (you need to show your "not working" code"). Or you can simply run AutoCAD command "ATTSYNC" after the block definition being updated (adding a new attribute definition).

Norman Yuan

Drive CAD With Code

EESignature

0 Likes