Bobzy20 Posted May 10, 2013 Posted May 10, 2013 I have a drawing which has multiple blocks. When I explode one block there is an identical block underneath on layer 0. Is there a way in AutoCAD 2012 to select all the blocks on layer 0 and delete them so that it would leave me with just the one set of blocks? Quote
Bobzy20 Posted May 10, 2013 Author Posted May 10, 2013 Tried that with many different options but can't get it to work for me. Quote
dbroada Posted May 10, 2013 Posted May 10, 2013 works for me with 2013 but I am sure it was the same with 2011. Quote
mech Posted May 10, 2013 Posted May 10, 2013 what happens when you PURGE the drawing and select blocks? Quote
Bobzy20 Posted May 10, 2013 Author Posted May 10, 2013 Everything is purged out of the drawing but all the blocks remain as they aren't exploded. Quote
RobDraw Posted May 10, 2013 Posted May 10, 2013 I've seen this before when cleaning up incoming architectural backgrounds but it's been a while. Are these blocks possibly AEC objects, walls, doors, windows, etc. or could they have been at some point? Quote
neophoible Posted May 10, 2013 Posted May 10, 2013 Here is a simple routine to do the trick. It is written specifically for deleting ALL block insertions on layer 0. (defun C:Del0Blocks (/ SelBlk PrmStr) (setq PrmStr " block insertions on Layer 0" SelBlk (ssget "X" '((0 . "INSERT") (8 . "0"))) ) (cond ( (not SelBlk) (prompt (strcat "Found no" PrmStr ".")) ) ( (initget "Yes No") ) ( (/= "Yes" (getkword (strcat "Really want to delete all" PrmStr "? [Yes/No]: <N> " ) ) ) ) (T (command "_.ERASE" SelBlk) ) ) ) It will find the blocks but not delete them (I think), if they are not user selectable. So, unlock, thaw, turn on Layer 0. It also expects one more Enter at the end just to make sure. Quote
neophoible Posted May 10, 2013 Posted May 10, 2013 Just in case--NOTE: A block can be inserted on a layer but, due to its definition, also have entities that appear on other layers. Erasing such a block because it is inserted on a certain layer still erases it entirely. Quote
Bobzy20 Posted May 10, 2013 Author Posted May 10, 2013 Thanks for all your answers, i will check this out Monday. How do you run code like that in AC? Quote
neophoible Posted May 10, 2013 Posted May 10, 2013 Thanks for all your answers, i will check this out Monday. How do you run code like that in AC? You're quite welcome. Check out this thread: How to use the LISP routines in this archive - CADTutor http://www.cadtutor.net/forum/showthread.php?1390-How-to-use-the-LISP-routines-in-this-archive Quote
Recommended Posts
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.