Jump to content
KrashVegas

Replacing Portion of Blocks in AutoCAD 2018

Recommended Posts

KrashVegas

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
halam

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

Follow these steps 1+2

 

 

Step 1. New block

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

 

 

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.

 

https://www.linkedin.com/pulse/autocad-block-tool-hans-lammerts?articleId=6294066308657094656#comments-6294066308657094656&trk=prof-post

 

 

 

 

 

 

What solution does this Autodesk other forum provide?

Share this post


Link to post
Share on other sites
Aftertouch

I always use this code:

 

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

(if (/= newblockname "")
(progn
(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

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...