Jump to content
lanakolo

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

Recommended Posts

lanakolo

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

Share this post


Link to post
Share on other sites
mikekmx

no inbuilt tool to do this AFAIK.

(as you prob know) this will need a LISP (or other) routine.

Share this post


Link to post
Share on other sites
lanakolo

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.

Share this post


Link to post
Share on other sites
BIGAL

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.

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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