LeeNichols Posted February 28, 2019 Posted February 28, 2019 I have a block with about 60 single-line text entities, 40 of which have a place holder character that needs to change based on how the block is used. For example, "~1a" and "~1b" need to change to "P1a" and "P1b", where "~" is the place holder and "P" is the letter for this 1 block. The next instance of the same block will need a different letter. This is not a good application for attributes. I found Lee Mac's LISP c:ReplaceBlockText in this thread using vlax-for, but it appears to work on the block definition and changes the text for every instance of the block in the drawing. I need this to work on 1 selected instance of the block. Any help is appreciated, even if it's a point in the right direction. Quote
Lee Mac Posted March 1, 2019 Posted March 1, 2019 19 hours ago, LeeNichols said: I have a block with about 60 single-line text entities, 40 of which have a place holder character that needs to change based on how the block is used. For example, "~1a" and "~1b" need to change to "P1a" and "P1b", where "~" is the place holder and "P" is the letter for this 1 block. The next instance of the same block will need a different letter. This is not a good application for attributes. I found Lee Mac's LISP c:ReplaceBlockText in this thread using vlax-for, but it appears to work on the block definition and changes the text for every instance of the block in the drawing. I need this to work on 1 selected instance of the block. Any help is appreciated, even if it's a point in the right direction. If the single-line text is part of the block, then changing the text content will change it for all references of the block - this is how blocks work. If you require a different value for each block, you should use block attributes as the only other alternative is to create a new block definition for each possible value, which defeats the point of using a block at all. Why do you state : Quote This is not a good application for attributes Quote
LeeNichols Posted March 1, 2019 Author Posted March 1, 2019 Lee Mac, thanks for the reply. After further research, I came to that understanding yesterday. I was hoping to tweak the text in the block using LISP based on a 1-character answer from the user. I didn't want the user to have to modify almost 40 attributes. However, it's easy enough to do with AutoCAD's Find/Replace function. Thanks again 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.