Author Topic: Can't get rid of a layer in a drawing  (Read 1629 times)

0 Members and 1 Guest are viewing this topic.

iliekater

  • Guest
Can't get rid of a layer in a drawing
« on: April 17, 2008, 05:11:05 AM »
I have a drawing file and among other layers , there is also the "Dimensions" layer . I want to delete that layer but I can't . I used the PURGE command but it shows me that it cannot be purged . I can't find any objects containing that layer and that layer is not the current one .
The only thing I noticed is that if I select all objects on layer "Electrical" and explode them , then I can delete the "Dimensions" layer . But I wonder , how can it be that I can purge that layer only if I explode some items ? ! I mean after exploding them there isn't any object revealed on the "Dimensions" layer ! It's like a ghost layer !
If you wish , you can try it here :
http://rapidshare.com/files/108163616/1.dwg.html

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Can't get rid of a layer in a drawing
« Reply #1 on: April 17, 2008, 05:20:35 AM »

How about adding the file as an attachment here ..
rapidshare thinks I'm currently downloading it ... I'm not !
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Glenn R

  • Guest
Re: Can't get rid of a layer in a drawing
« Reply #2 on: April 17, 2008, 05:43:04 AM »
It's probably a 'BlockBegin' object that has been created using that layer. These are non-graphical objects that signify the 'begining' of a block definition and it's corresponding entry, 'BlockEnd'.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Can't get rid of a layer in a drawing
« Reply #3 on: April 17, 2008, 08:25:41 AM »
There are 42 attributes with a SEQEND on layer "Dimensions" attached to the electrical blocks. By exploding the blocks, the seqend is removed and the attributes become text or attribute definitions, depending upon how you explode them.

The reason this happens is that when a block with attributes is inserted, SEQEND takes on the layer of the current layer. Subsequently changing the block and associated attributes to a different layer does not change the SEQEND entry.

To see this problem in action, create a completely new layer and set it current, insert a block with attributes on that layer, then change the layer of the block to a different layer, set a different layer current and try to purge the new layer. You will find it no longer will purge.

To correct this you can set the correct layer and re-insert the offending blocks or you can merge the offending layer with the electrical layer.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Can't get rid of a layer in a drawing
« Reply #4 on: April 17, 2008, 08:36:48 AM »
Quote from: iliekater
I have a drawing file and among other layers , there is also the "Dimensions" layer . I want to delete that layer but I can't . I used the PURGE command but it shows me that it cannot be purged . I can't find any objects containing that layer and that layer is not the current one

Use LAYMRG and merge it onto layer "0".

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Can't get rid of a layer in a drawing
« Reply #5 on: April 17, 2008, 09:58:28 AM »
Here is a piece of code I modified to suit the current needs:

Code: [Select]
;;;   SEQFX.LSP
;;;   Copyright (C) 2000-2008 by K.E. Blackie
;;;
;;;   kblackie -AT- resourcecad.com
;;;
;;;   Permission to use, copy, modify, and distribute this software
;;;   for any purpose and without fee is hereby granted, provided
;;;   that the above copyright notice appears in all copies and that
;;;   both that copyright notice and this permission notice appear in
;;;   all supporting documentation.
;;;
;;;   THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED
;;;   WARRANTY.  ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR
;;;   PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.
;;;
;;;
;;;
;;;   23 October 2000
;;;   17 April 2008
;;;
;;;----------------------------------------------------------------------------
;;;   DESCRIPTION
;;;----------------------------------------------------------------------------
;;;   C:SEQFX
;;;
;;;   This function fixes seqend entries on all block references caused
;;;   by inserting a block with attributes on a wrong layer or from changing
;;;   a block layer after it is inserted.
;;;   All attributes are left in place and remain unmodified.
;;;   The seqend object is moved to the current layer of the block reference.
;;;   No error checking is provided. It is presumed the user will know if there
;;;   are blocks with attributes already inserted in the drawing.
;;;
;;;----------------------------------------------------------------------------
;;;----------------------------------------------------------------------------

(defun C:SEQFX ()
  (setq sset (ssget "x" '((0 . "INSERT")(66 . 1)))
ndx 0)
  (repeat (sslength sset)
    (setq eobj (ssname sset ndx)
          elay (cdr (assoc 8 (entget eobj)))
          tmp (entnext eobj)
    )
    (while (/= "SEQEND" (cdr (assoc 0 (entget tmp))))
      (setq tmp (entnext tmp))
    )
    (setq seqend (vlax-ename->vla-object tmp))
    (vla-put-layer seqend elay)
    (setq ndx (1+ ndx))
  )
  (princ)
)
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

daron

  • Guest
Re: Can't get rid of a layer in a drawing
« Reply #6 on: April 18, 2008, 05:08:43 PM »
laydel also works. Just draw a line on offending layer, and select that line when running laydel. It should go away.

Crank

  • Water Moccasin
  • Posts: 1503
Re: Can't get rid of a layer in a drawing
« Reply #7 on: April 19, 2008, 03:54:34 AM »
laydel also works. Just draw a line on offending layer, and select that line when running laydel. It should go away.
But then you also may lose data. I prefer LAYTRANS but LAYMRG is also a good option.
Vault Professional 2023     +     AEC Collection