Jump to content

how to increase/decrease attribute value in several blocks at once


Recommended Posts

Hello there,



I have a multitude (over 400) of blocks with attributes in my drawing. The format is 02W-01 / 02W-02 / 02W-03 and so on to 02W-407. I used INCREMENT.lsp to create the numbering. When I have to insert a label in between two existing ones, then all the subsequent labels have to increase their number by 1.

Is there a way to increase the attribute value automatically in several blocks? Doing it by clicking every each of them with INCREMENT.lsp is a very tedious work.



Thank you,


Link to comment
Share on other sites

thanks for the fast reply. I do know that there is no inbuilt tool for that. I was looking for a LISP routine or something similar.

Link to comment
Share on other sites

Quite doable have you searched for any lisp that retrieves a blocks attribute value and changes it ? If not do so there are heaps of examples here !


Ok once you get it create a selection set and get it to stop when the attribute value is equal to "02W-123" wow your nearly there. You need a second defun that pulls apart the attribvalue "02W" + "123" then just check 2nd part is greater than 123 add 1 use strcat to create "02W-124" then replace attribute value. Repeat for all blocks. Now let me see for that code oh yeah you didn't provide block name or attribute tag name, please post a dwg would be better.


A couple of extra questions are the values always 01W or upto 99W not 1W and is -999 the max or will you go to 1000+ makes a big diffrence in a real simple answer.

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.

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...