Jump to content

Renaming blocks


Haniye

Recommended Posts


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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...