Jump to content

Modify Single Block Attribute


Recommended Posts

Hi everyone,


I've been a lurker here for a while trying to wrap my head around some of the ins and outs of using LISP and ACAD. From searching here and some other CAD/LISP sites I have found some scripts that do more then I want and I have tried to modify them but only with moderate success.


I am wanting to create a simple script that will allow me to select a block and change a single attribute's value to something else. I know I can do this with EATTEDIT but it's not as streamlined as I would like. All of my blocks have 12-14 differenct attributes. The only one I am wanting to change by this method is "POSITION". I don't like assigning it as I am inputting the blocks as the value generally changes as my drawing progresses. I do not want to change the attribute in all instances of the block in the drawing, just the instance that I have selected.


After I place all my blocks I want to be able to sort by this POSITION to edit the rest of the tags. I update the other attributes through a link with Excel but without knowing the POSITION then the values of the rest all overlap. Or is there any way I could automatically update the POSITION attribute based on location in the drawing? Say I'm placing these blocks on different "pipes/lines" in the drawing. If I name each "pipe" could that somehow be come the name for POSITION? This way if I have 20 blocks on the same pipe I don't need to modify the attribute for each one individually. I imagine something like that is possible but would probably involve updating my existing blocks.


Any help with this would be great. I've figured out how to select the block and get a list of all the sub-entities but then I start to stumble.



Kevin Humphrey

Link to comment
Share on other sites

That seems to do the trick.


Hadn't even thought about grabbing the attribute directly. The attribute is usually on a non-visible layer but it's a simple matter to make it visible to edit then hide it again. Really nice that it loops itself too.




Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...