lanakolo Posted March 4, 2014 Posted March 4, 2014 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, Lana Quote
mikekmx Posted March 4, 2014 Posted March 4, 2014 no inbuilt tool to do this AFAIK. (as you prob know) this will need a LISP (or other) routine. Quote
lanakolo Posted March 4, 2014 Author Posted March 4, 2014 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. Quote
BIGAL Posted March 5, 2014 Posted March 5, 2014 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. Quote
lanakolo Posted March 5, 2014 Author Posted March 5, 2014 Thanks BIGAL - I am attaching a drawing to show the situation. RenumberBlocks.dwg Quote
Recommended Posts
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.