Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Help Fix Attribute Fields Association in AutoCAD Blocks

mmawad
Enthusiast

Help Fix Attribute Fields Association in AutoCAD Blocks

mmawad
Enthusiast
Enthusiast

Hi everyone,

I'm facing an issue with attribute blocks in AutoCAD where the fields within these attributes are incorrectly associated with data from other blocks. I need the fields to only read data from the block they are in.

 

Currently, I have a large number of blocks affected by this problem, and manually cutting and pasting each block individually into a new file will fix it (the bad field will appear as "####") but is not feasible due to the volume of blocks.

 

I'm looking for a way to automate this process. Is there a script, command, or any method in AutoCAD that can help fix the associations of these attribute fields so they only read data from their own block?

 

Any help or guidance would be greatly appreciated!

Thank you in advance!

0 Likes
Reply
243 Views
2 Replies
Replies (2)

ec-cad
Advocate
Advocate

Please post a sample drawing, along with the expected results, or an explanation of what is expected.

I'm sure someone here can help you out.

 

ECCAD

0 Likes

Sea-Haven
Mentor
Mentor

When you insert a block with fields you are correct must update the say attribute Id's, for the current block. I use this in put sum of two attributes into a 3rd attribute. A lisp looks at current block.

 

This is not what I was looking for but close.  Modify to suit. Rather than select attribute do it via tag name.

(defun C:att2 (/ obj objID area hname content units)
	(setq obj (vlax-ename->vla-object (car (nentsel "\nSelect attribute "))))
	(setq objID (rtos (vla-get-objectid obj) 2 0))
	(setq atname (strcat "%<\\AcObjProp Object(%<\\_ObjId " objID ">%).Textstring>%"))
	(setq obj (vlax-ename->vla-object (car (nentsel "\nSelect attribute 2 "))))
	(vlax-put obj 'Textstring atname)
(princ)
)

 Modify to suit. 

0 Likes