PDA

View Full Version : Delete layers that wont delete



seashell2day
31st Mar 2009, 07:49 am
How do i delete layers in autocad 2009 when the sign comes up that the layers are being used when they are clearly not. How can i find out what is holding onto my layer & stopping it from going? I use quick select to select everything on the layer i want to delete. It selects nothing because there is nothing on the layer i want to delete. It's not the current layer, not the 0 layer & it's not used by any xref. how do i delete it?

CarlB
31st Mar 2009, 08:11 am
Could be that a block attribute is on that layer.

Does 2009 have the Express Tools "laydel" command? Draw an object on the layer to be deleted, run "laydel", select that object...or so I heard explained better at this site recently.

Lee Mac
31st Mar 2009, 09:01 am
Could be that a block attribute is on that layer.

Does 2009 have the Express Tools "laydel" command? Draw an object on the layer to be deleted, run "laydel", select that object...or so I heard explained better at this site recently.

Not sure if laydel is actually mainstream now on '09 - I heard that laymrg is mainstream, so maybe laydel is also. :)

ReMark
31st Mar 2009, 10:51 am
AutoCAD 2009:

Menu Browser > Format > Layer Tools > Layer Delete.

If all else fails you can WBlock out everything you can see in the drawing then start a new drawing and insert what you have. Check to see if the problem layers still exist.

MiGo
31st Mar 2009, 01:55 pm
For MEP 2008 the Laydel is a fully functional command, so my guess is it should be in Acad 2009. Just draw a line on the layer you want to delete type in "laydel" and select the line, or you can just type in "laydel" and hit "n" for name and a dialog box should pop up with all the current layers. Just select the one you want gone and it will delete the layer and all of the contents on that layer.

Lee Mac
31st Mar 2009, 02:38 pm
You can use this to check block entities on layers:



; Get All on Layer by Lee McDonnell

; Args:- layer (string)

(defun get_all_on_layer (layer / ss eLst blks att aBlst ents eBlst)
(if (tblsearch "LAYER" layer)
(progn
(setq eBlst (strcat "Entities within Blocks on Layer " layer ": \n\n"))
(foreach x (blk_list)
(setq ents (entnext (tblobjname "BLOCK" x)))
(while ents
(if (eq layer (cdr (assoc 8 (entget ents))))
(setq eBlst (strcat eBlst (cdr (assoc 0 (entget ents))) " Within Block: " x "\n")))
(setq ents (entnext ents))))
(alert eBlst))
(princ "\n<!> Layer Not Found in Drawing <!>"))
(princ))


(defun blk_list (/ bLst)
(vlax-for blk
(vla-get-blocks
(vla-get-activedocument
(vlax-get-acad-object)))
(setq bLst (cons (vla-get-name blk) bLst)))
(setq bLst (vl-remove-if
(function
(lambda (x) (or (wcmatch x "*PAPER*") (wcmatch x "*MODEL*")))) bLst))
bLst)


(defun c:test ()
(get_all_on_layer (getstring "\nSpecify Layer: "))
(princ))