Jump to content

Replacing Portion of Blocks in AutoCAD 2018

Recommended Posts


How is this done? I noticed on the Autodesk website forum that there is an actual "replace block" command for the Architecture and MEP programs, but I can't figure out the best way to do it in regular AutoCAD 2018 other than manually using snaps and layering.


Basically I have about 100 blocks in a drawing, made a new block that's the same dimensions just a different color, and need to swap out some (but not all) of the existing blocks for the "new" one that I made.


Thanks everyone.

Share this post

Link to post
Share on other sites

Either you update blocks. or you copy a new block definition.

Follow these steps 1+2



Step 1. New block




Step 2. Replace one with the other

I dedicated this page for the solution Tharwat provided. Maybe it can lead to some ideas for even improving it.

Annotative blocks can be hard to handle. I think this is deep down AutoCAD behaviour which I can't fully understand.









What solution does this Autodesk other forum provide?

Share this post

Link to post
Share on other sites

I always use this code:


; setq oldblocksome in a way you like first...
; setq newblocksome in a way you like first...

(if (/= newblockname "")
(setq blockobjecten (ssget "_X" (list (cons 0 "INSERT")(cons 2 oldblockname))))
(setq n (sslength blockobjecten))
	(repeat n
		(setq ensel (ssname blockobjecten (setq n (1- n))))  
		(setq enlist (entget ensel))		;; Set DXF group codes          
		(setq xyz (cdr (assoc 10 enlist)))	;; Set coordinates
		(command "-insert" newblockname xyz "1" "1" "")
	(command "ERASE" blockobjecten "")


This allows you to replace one block for another, but does not mess up scales with annotations or anything.

It just places the new block on the old blocks location, and then deletes the old one.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now