Replace block

Replace block

Anonymous
Not applicable
114,427 Views
10 Replies
Message 1 of 11

Replace block

Anonymous
Not applicable

Hello,

Here I have got some tough task, I have n number of blocks with unidentical names, I want to replace all those blocks with a newly created block. Could  you please guide me to complete this task? TIA

0 Likes
Accepted solutions (2)
114,428 Views
10 Replies
Replies (10)
Message 2 of 11

ennujozlagam
Mentor
Mentor
Accepted solution

@Anonymous hello.

 

Follow these steps:
  1. Make sure that the new block you want to insert is defined in the drawing. ...
  2. Choose Express> Blocks> Replace Block with Another Block or enter blockreplace on the command line.
  3. In the BLOCKREPLACE dialog box, choose the block that you want to replace from the list of blocks in the drawing.




Remember : without the difficult times in your LIFE, you wouldn't be who you are today. Be grateful for the good and the bad. ANGER doesn't solve anything. It builds nothing, but it can destroy everything...
Please mark this response as "Accept as Solution" if it answers your question. Kudos gladly accepted.
Message 3 of 11

Anonymous
Not applicable

Thanks a lot.

 

I have a drawing with n number of blocks with unidentical names, here I want to replace all those blocks with a newly created block or rename all other blocks with the new name. Is there any possibility to do that?? 

 

 

If needed I can attach the drawing.

 

0 Likes
Message 4 of 11

ennujozlagam
Mentor
Mentor

@Anonymous hello, you can try to check it <<click HERE>>. thanks





Remember : without the difficult times in your LIFE, you wouldn't be who you are today. Be grateful for the good and the bad. ANGER doesn't solve anything. It builds nothing, but it can destroy everything...
Please mark this response as "Accept as Solution" if it answers your question. Kudos gladly accepted.
0 Likes
Message 5 of 11

Kent1Cooper
Consultant
Consultant

Another one is BlockReplace.lsp, available here, with the BRS command it contains [= Block Replace, Selected].  It also has a BRA command [= Block Replace, All] in which you pick one insertion of the Block you want replaced, and it replaces all insertions of that Block with the specified replacement Block.

Kent Cooper, AIA
Message 6 of 11

john.vellek
Alumni
Alumni

Hi @Anonymous,

 

I see that you are visiting as a new member. Welcome to the Autodesk Community! 

If the great suggestions in this thread don't get your blocks replaced the way you want, please attach a sample file and I am happy to take a look if there is another way to do this.

 

 


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 7 of 11

Anonymous
Not applicable

Hello John,

Hereby I have attached the AutoCA drawing for you reference. In the attachment you can find two different types of blocks with nonidentical names. i just want to replace those blocks with new other two blocks. 

0 Likes
Message 8 of 11

Kent1Cooper
Consultant
Consultant
Accepted solution

I think you're out of luck.  There are close to 7,000  (!) Blocks in that drawing, apparently every one with its own separate Block name, every one inserted only once, and worst of all, every one defined with its insertion base point in the same place!  So no Block's insertion point has any logical or repeatable relationship to its image elements.

 

Any routine designed to replace Blocks is going to keep their insertion points, scale factors and rotations as they are, and just put in a replacement Block of a different name, using all those properties.  I Zoomed in arbitrarily and found a Block 6946 near a Block 6947, and used my BlockReplace.lsp routine's BRA command to replace "all" 6947's [there was only one] with 6946.  It did, but the replacement 6946 Block was [as it should be] inserted at the same 0,0 insertion point and 1 scale factors and 0 rotation as the 6947 Block it replaced had, which means it came in sitting right on top of the other 6946 Block nearby [which shares all those properties, as do all the rest of the Blocks in the drawing], and not with the image elements where the 6947 Block was.

 

It looks like there may be only two shapes of image involved, but since there are literally thousands of each shape, with thousands of individual Block names, all sharing the same insertion point and therefore with a different relationship of its image elements to the insertion point from every other such Block, I am at a loss to imagine a way to automate replacing all those of one shape with one Block, and all those of the other shape with another Block -- you may be stuck with doing it manually and tediously.

 

One thing I thought might work, but didn't:  Since the Blocks all have their insertion points at 0,0, I thought maybe an element in each [since they are "defined" in terms of locations in relation to the insertion base point ] could be used out in the overall drawing as the insertion point to place a different Block with a logical insertion point.  But I tried one of the vertical-line-in-"parentheses" shapes, and got the location of the start point of the first element in it [a Polyline, I think the vertical middle line], and used that location as the start point of a Line.  It didn't actually lie on the endpoint of any of the elements in that Block, so that wouldn't be a viable approach.  That locational difference may be somehow because they are all so hugely far away from the origin.

 

Since the drawing was generated by some program other than AutoCAD [I was warned when opening it], can you go back to the source and see whether there are any option(s) as to how to turn it into an AutoCAD drawing, that might give you a better result for what you're trying to do?

 

Kent Cooper, AIA
Message 9 of 11

Anonymous
Not applicable

blockreplace.lsp doesn't seem to work in 2019

0 Likes
Message 10 of 11

cadffm
Consultant
Consultant

Nothing to do with the Version, but with your blocks.

https://forums.autodesk.com/t5/francais/ct-p/5054

 

The Adesk Express Blockreplace function is a very old dinosaur, it isn't the right tool for using with new features like dynamic blocks and annotation scales.

 

It works as designed, decades before

Sebastian

Message 11 of 11

Josh-Riddell
Participant
Participant

Was having the same issue, and this helped much more than the built-in BLOCKREPLACE command, as the built-in command only gives a prompt to replace ALL instances of a block.  This LISP command comes in really handy if you're trying to replace only a selection of blocks.

 

Thanks!

0 Likes