+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Junior Member
    Using
    AutoCAD 2018
    Join Date
    Aug 2012
    Posts
    15

    Default Replacing Portion of Blocks in AutoCAD 2018

    Registered forum members do not see this ad.

    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.

  2. #2
    Super Member halam's Avatar
    Using
    AutoCAD 2017
    Join Date
    Jul 2015
    Posts
    646

    Default

    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/autoc...&trk=prof-post






    What solution does this Autodesk other forum provide?
    Modelling is done with two hands, 2d & 3d. Let it work together..
    https://twitter.com/halammerts

  3. #3
    Senior Member
    Discipline
    Civil
    Aftertouch's Discipline Details
    Discipline
    Civil
    Details
    Engineer
    Using
    AutoCAD 2017
    Join Date
    Jul 2016
    Location
    Netherlands
    Posts
    251

    Default

    Registered forum members do not see this ad.

    I always use this code:

    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.

Similar Threads

  1. AutoCAD 2018.1 and AutoCAD LT 2018.1 Update Now Available
    By Between the Lines in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 28th Jul 2017, 01:10 am
  2. Replacing Blocks
    By SAM_R in forum AutoCAD General
    Replies: 8
    Last Post: 18th May 2015, 08:06 am
  3. Replacing Many Blocks With One
    By AQucsaiJr in forum AutoCAD General
    Replies: 3
    Last Post: 19th Dec 2008, 02:58 pm
  4. Replacing Blocks
    By Rooster in forum AutoCAD General
    Replies: 8
    Last Post: 24th Jul 2008, 04:55 pm
  5. Replacing blocks
    By Stormcrow_666 in forum AutoLISP, Visual LISP & DCL
    Replies: 20
    Last Post: 25th Apr 2008, 03:04 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts