Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

block rename lsp

14 REPLIES 14
SOLVED
Reply
Message 1 of 15
Anonymous
11945 Views, 14 Replies

block rename lsp

hello expert friends, always thanks

should I get block rename lsp???

there are same blocks and select blocks, and then change blocks name

I attached jpg file. waitting for some help. advanced thank you all

 

14 REPLIES 14
Message 2 of 15
dbhunia
in reply to: Anonymous

Hi

 

Check this.....

 

http://www.lee-mac.com/copyblock.html


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
Message 3 of 15
Anonymous
in reply to: dbhunia

thank you your answer.
but this lisp is only one selected

I want it multi objects selected lsp

Message 4 of 15
dbhunia
in reply to: Anonymous

Hi

 

First thing You can not Rename the existing Blocks in a drawing with SAME name......

 

And what I got from your attached image ...... The blocks which you want to rename, are same block with same properties (scale factor, rotation, layer .... etc.).......

 

In that case I suggest to copy a Block with New Name and insert the Newly Named Block in place of Old Block (The Blocks which you want to Rename) ........

 

Try this ...... I had made some rough changes in @Lee_Mac code....

 

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
Message 5 of 15
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:

.… should I get block rename lsp???

there are same blocks and select blocks, and then change blocks name ....


 

I think Blockreplace.lsp with its BRS command, >here<, may do what you want.  It allows selection of multiple Blocks to be replaced, and replaces each with the Block name you've specified, at the same rotation and scale(s), and on the same Layer, etc., as the one(s) being replaced.

Kent Cooper, AIA
Message 6 of 15
Shneuph
in reply to: Kent1Cooper

The way I always do this is to:

Select all the blocks you want to rename.

Copy them with basepoint 0,0,0

Paste in new drawing with basepoint 0,0,0

Rename the block. (you can use the rename command)

 

Delete the original set of blocks from the 1st drawing
Copy newly named blocks from 2nd drawing back into the 1st drawing with the same process as before.

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Message 7 of 15
dbhunia
in reply to: Shneuph

Hi

 


@Shneuph wrote:

The way I always do this is to:

Select all the blocks you want to rename.

Copy them with basepoint 0,0,0

Paste in new drawing with basepoint 0,0,0

Rename the block. (you can use the rename command)

 

Delete the original set of blocks from the 1st drawing
Copy newly named blocks from 2nd drawing back into the 1st drawing with the same process as before.


 

The above way you will Rename all the existing Blocks in the Drawing......

 

Here the Requirement is to Rename few selected Blocks ........... Which is not possible without Copying the Block with a New Name & Reinserting them at the Selected Blocks Position (Simply Replacing the Selected Blocks with New one).....


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
Message 8 of 15
Shneuph
in reply to: dbhunia

"Select all the blocks you want to rename."

 

You select only the blocks you want to rename.. Then copy them back.  The leftover blocks in dwg 1 with the same name will remain.  The ones you did the copying to will have their new name and copy back into the original drawing leaving the ones you left intentionally.

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Message 9 of 15
Shneuph
in reply to: dbhunia

See Screencast

 

https://autode.sk/2zw4CXs

 

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Message 10 of 15
_Tharwat
in reply to: Anonymous

This is a singular pick but generic one I believe. 

https://autolispprograms.wordpress.com/rename-a-block/

RenameBlock.PNG

Message 11 of 15
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:

.... there are same blocks and select blocks, and then change blocks name ....


 

Can we get a clarification?  I'm not sure any more what you mean by "rename" and "change blocks name" in this situation. 

 

Are you talking about picking some of the "xo-1" Blocks in your example, and changing them to Blocks of the name "aaa"?  That is, replacing them with "aaa" Blocks?  With "aaa" already being a Block defined in the drawing? And if the "aaa" Block definition is different from the "xo-1" Block, they would look different [which they don't in your image]?  That is what I assumed from the wording in the image, and it is what my BlockReplace.lsp routines do.

 

Or [since they don't  look any different in your image] do you mean that you want a new Block definition created, that is the same as the "xo-1" Block but has the new name "aaa" instead?  [Presumably you would not want two identical Block definitions under different names, but you would then edit the new one with whatever differences you need.]  If that's what you're after, there are routines out there to make a new Block out of an existing one, such as my BlockDupNewName.lsp with its BDN command, which is in the .zip file attached >here<, or several on the Cadalyst CAD Tips site such as >this one< and >this other one<, and no doubt others.

Kent Cooper, AIA
Message 12 of 15
Anonymous
in reply to: Kent1Cooper

thank you all. have a good day.

Message 13 of 15
Kent1Cooper
in reply to: Kent1Cooper


@Kent1Cooper wrote:
.... to make a new Block out of an existing one, such as my BlockDupNewName.lsp with its BDN command....

 

For anyone who finds this looking for that kind of thing, BlockDupNewName.lsp has been upgraded [attached].

 

Aside from making the Undo begin-end operation suited to newer versions, and a small correction, this is what's improved:

 

It now uses a text-editing window up in the screen, rather than asking for a new name at the Command line.  That window is pre-populated with the name of the current Block and a hyphenated-number suffix.  So if a lot of the new name you want is the same as the old one, you can leave most of it and edit just part(s) of it, and don't need to type the whole thing in, as you did before if you didn't want the offered numerical-suffix new name.

 

It used to ask again if you either typed in a Block name already in the drawing or only a space or spaces, but it now also asks again if you "empty" the string in the editing window to nothing.

 

It used to offer a new Block name only by adding a hyphenated-number suffix on the selected Block's name.  That meant that if you had used BDN on something before, for instance starting with a Block named "Block" and you had accepted the offered new name of "Block-1"  [or other suffixed number], and then you later used it again on one of those "Block-1" Blocks, it used to offer "Block-1-1" as the new name.  It now recognizes that the old name was likely the result of a BDN operation, and [whether that was the origin, or for any Block name ending in a hyphen and number(s) only] it offers the next available number suffix, in that case offering "Block-2" [if that isn't already used, similarly incrementing up from there if it is].

Kent Cooper, AIA
Message 14 of 15
arpansark0544TCX
in reply to: _Tharwat

This program is quite useful as it saves some time to search for block names.
Thank you.
Message 15 of 15
_Tharwat
in reply to: arpansark0544TCX


@arpansark0544TCX wrote:
This program is quite useful as it saves some time to search for block names.
Thank you.

You're welcome anytime.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report