Jump to content

Unable to remove some layers . . .


Guest Dog

Recommended Posts

I am trying to clean up an old drawing by removing layers that I'm not using any more. I have tried to delete the layer manually (Oh and I am using AutoCAD 2005) in the layers properties manager and that doesn't work. I have turned all other layers off, locked them and tried to select any objects on the layer I am trying to remove and I cannot find any. I have also locked everything else and tried selecting all and then deleting everything but even that doesn't work. Are there any ways to forcefully remove layers without deleting or moving everything off them? Is there any way to select only objects on that layer and get rid of them that way? I think the latter is possible however I can't see anything on these layers when everything else is turned off.

Link to comment
Share on other sites

Guest Jorge Mayor

Hello;

 

There is a tool called Quick Select on the object properties, on that window select LAYER under the properties tab, then = the name of the layer you are trying to delete and click Ok; it should select only that layer, once selected try to change it to another layer, then purge your archive; ohh also there are times when a layer is part of a block and that block its inserted under another layer so when you turn off the block layer it turns off also the layer you are trying to delet; hope I didn't confuse you more ja...

Link to comment
Share on other sites

Thanks for the tips. The quick select method didn't select any objects on any of the layers so I think it might be that they are blocks. However I don't know what to do about it or how to find out what layer they are attached to.

Link to comment
Share on other sites

What I have used for this is selection ALL. This selects everything on the drawing even unseleable items. You can go ERASE ALL then R for remove then select all items with crossing box you want to keep. This will delete all the 'unselectable items' in your drawing.

I find that culprits are bits of text (with no text in them) and exploded dims and nodes etc. You can use LIST in the same way to find out what they are before you delete them (recommended).

This is all fine unless you have a block with these layers in them! How do you find out, EXPLODE all your blocks see what appears on those layers. Hope this helps.

Link to comment
Share on other sites

I have have that problem in the past so i found a LISP that says it could delete the layer....but I have not tried ot myself, so i do not recomened or take responcibility for its outcomes :twisted: :?

 

but if all else fails

 

; Delete Layer(s)

; Written by Mark Thomas

; This file contains 2 functions:

; del-layer will delete all objects on a selected layer and purge it

; mdel-layer will delete all objects on selected layers and purge them

 

(defun c:del-layer (/ ent l_name ss cntr amt ssent)

 

;;;

;;; erases all objects on selected layer then purges that layer

;;;

 

(setvar 'clayer "0") ; set layer to 0

 

(if

; make sure we get something

(setq ent (car (entsel "\nSelect layer to remove: "))); test

(progn

; extract the layer name from the entity

(setq l_name (cdr (assoc 8 (entget ent))))

 

; create a selection set of all entites on layer 'l_name'

(setq ss (ssget "X" (list (cons 8 l_name)))

; set 'cntr' to number of items in selection set

cntr (1- (sslength ss))

amt (itoa cntr); make a string from an integer

)

 

(if

; does the sel set have anything in it

(> cntr 0); test

 

(while

; as long as 'cntr' is greater than or equal to 0

; keep looping

(>= cntr 0)

 

; extract the ename from the sel set

(setq ssent (ssname ss cntr))

(entdel ssent); delete that entity

(setq cntr (1- cntr)); subtract 1 from cntr

)

 

)

)

)

(command "_.purge" "LA" l_name "N")

(princ (strcat "\nErased " amt " items"))

(princ)

)

 

;;;

;;; erases all objects on selected layers and purges them

;;;

 

(defun c:mdel-layer (/ lst)

(setq cmd (getvar 'cmdecho))

 

; turn off the echo!

(setvar 'cmdecho 0)

 

(if

; make sure we get a list before we continue

(setq lst (fx-make-layer-list)); test

 

; now that we have a list run 'fx-rm-layer' on each of those items

(mapcar '(lambda (x) (fx-rm-layer x)) lst)

)

 

; reset the variable

(setvar 'cmdecho cmd)

(princ)

)

 

;;;

;;; functions ======================================================

;;;

 

(defun fx-rm-layer (l_name / ss sntr amt ssent)

 

;;;

;;; erase and purges all entites on 'l_name', a string

;;; returns the number of objects erased

;;;

 

(setvar 'clayer "0")

 

(if

; make sure the layer exists in the dwg

(tblsearch "layer" l_name); test

(progn ; continue

(setq ss (ssget "X" (list (cons 8 l_name)))

cntr (1- (sslength ss))

amt cntr

)

 

(if (> cntr 0)

(while

(>= cntr 0)

(setq ssent (ssname ss cntr))

(entdel ssent)

(setq cntr (1- cntr))

)

)

)

)

(if (> amt 0)

(command "_.purge" "LA" l_name "N")

)

; return the amount of entites erased

amt

)

 

 

(defun fx-make-layer-list (/ ent l_name entlst)

 

;;;

;;; generate a list of layer names based on user selection

;;; and returns that list

;;;

 

(while

; while user is selecting something continue loop

(setq ent (car (entsel "\nSelect Item on Layer: "))); test

 

; extract layer name from selected entity

(setq l_name (cdr (assoc 8 (entget ent))))

(prompt l_name); output the layer

 

(if

; make sure the layer isn't already in the list

(not (vl-position l_name entlst)); test

 

; if not then add it to the list

(setq entlst (cons l_name entlst))

)

)

)

 

Link to comment
Share on other sites

Draw a temporary lines using layers you want deleted.

 

Type LAYDEL then pick those lines. After selecting everything you hate, enter to finish the command then a warning pops up. Enter yes.

 

If you made a mistake, just undo. :wink:

Link to comment
Share on other sites

  • 2 months later...

Sometimes Purge works to remove the offending layer; but only if the layer is recognized by Purge as a layer that can be purged. You can have a layer with no objects in a drawing with no xrefs (layer not current) and the Layer Manager will not let you delete it; yet this layer may show up in the Purge tree and you can purge it

Link to comment
Share on other sites

  • 4 years later...

I tried some of these solutions.

 

I found that QSELECT Block Reference (which were actually on a different layer entirely) and deleting them, then PURGE, helped.

 

I realise that most people want to keep their Block References, but I don't use AutoCAD Map3D 2008 in that way, so didn't need any Block References at all. I expect you could refine your search and maybe use AUDIT to help?

Link to comment
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
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...