Haniye Posted May 3, 2023 Posted May 3, 2023 Hello and good evening. I'm looking for a .lsp script for renaming blocks with the same name inside the drawing with running code. example: Current block name: XXXYYY Amount of blocks: 5 pcs New block names: XXXYYY_1, XXXYYY_2, XXXYYY_3, XXXYYY_4, XXXYYY_5 The current block name should be given as a parameter or without a parameter it renames all blocks which occur more than one time in the drawing. could you help me with that, please? Quote
ronjonp Posted May 3, 2023 Posted May 3, 2023 Why would you want to do that? Sounds like you're creating a mess. 1 Quote
CyberAngel Posted May 3, 2023 Posted May 3, 2023 10 minutes ago, ronjonp said: Why would you want to do that? Sounds like you're creating a mess. Also, what happens when you add another block? When you delete one of them? You can't run the code again because all the blocks have different names. Conversely, I could use a routine to consolidate identical blocks that have different names. Quote
mhupp Posted May 4, 2023 Posted May 4, 2023 Also Wouldn't use blocks that use generic names with _## at the end. don't know how/what your setup is but if you copy block XXXYYY_1 into another drawing that already has XXXYYY_1 but is different thing can get messy fast. Quote
Steven P Posted May 4, 2023 Posted May 4, 2023 Looking at this, a problem with drawing management if each instance of a block has a different name, you might be better making the objects into a group perhaps instead of a block? 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.