Jump to content

Recommended Posts

Posted

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?

Posted

Tried that with many different options but can't get it to work for me.

Posted

works for me with 2013 but I am sure it was the same with 2011.

 

qselect.JPG

Posted

what happens when you PURGE the drawing and select blocks?

Posted

Everything is purged out of the drawing but all the blocks remain as they aren't exploded.

Posted

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?

Posted

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.

Posted

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.

Posted

Thanks for all your answers, i will check this out Monday.

 

How do you run code like that in AC?

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

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