Page 1 of 2 12 LastLast
Results 1 to 15 of 26

Thread: NOT purging layers

  1. #1
    andy drafter Guest

    NOT purging layers

    I'd like to be able to purge an entire drawing without deleting layers that have no objects. These layers may be used later in the drawing and I don't want to have to retype in layer names etc.

    I know I can be selective and not delete certain layers when purging but I'm wondering if there is a way to set up a drawing with protected layers so you can't delete them when you "purge all" even if they don't have objects.

  2. #2
    Paul Turvill Guest
    There are several ways. A layer won't be purged if it is "referenced" by an
    entity in a drawing. One way would be to create a (possibly dummy) viewport
    that has all layers "frozen in current viewport"; any layer that is frozen
    in one or more viewports is "referenced" and therefore not elegible for
    purging.
    ___

    "andy drafter" <nospam@address.withheld> wrote in message
    news:17178821.1101774909037.JavaMail.jive@jiveforu m2.autodesk.com...
    I'd like to be able to purge an entire drawing without deleting layers
    that have no objects. These layers may be used later in the drawing and I
    don't want to have to retype in layer names etc.

    I know I can be selective and not delete certain layers when purging but
    I'm wondering if there is a way to set up a drawing with protected layers
    so you can't delete them when you "purge all" even if they don't have
    objects.

  3. #3
    C Witt Guest
    attached a bit of code that was given to me in the customization group
    months ago.. now i give it to you.

    andy drafter wrote:
    I'd like to be able to purge an entire drawing without deleting layers that have no objects. These layers may be used later in the drawing and I don't want to have to retype in layer names etc.

    I know I can be selective and not delete certain layers when purging but I'm wondering if there is a way to set up a drawing with protected layers so you can't delete them when you "purge all" even if they don't have objects.

  4. #4
    andy drafter Guest
    Thanks, er.........where do I put this nifty piece of code? In fact, where can I find out EXACTLY how to manipulate this code?

    Thanks again.

  5. #5
    Dean Saadallah Guest
    explore the -PURGE command (note the dash), you can type what to purge to
    get rid of: lol, before you ask how is this faster than the pop-up, you can
    use this command the this knowledge in a new toolbar button macro or LISP.
    Customizing: whole reason you bought AutoCAD.

    --
    Dean Saadallah
    Add-on products for LT
    http://www.pendean.com/lt
    --

  6. #6
    Dave Jones Guest
    "andy drafter" <nospam@address.withheld> wrote in message
    news:17178821.1101774909037.JavaMail.jive@jiveforu m2.autodesk.com...
    I'd like to be able to purge an entire drawing without deleting layers
    that have no objects. These layers may be used later in the drawing and I
    don't want to have to retype in layer names etc.
    I know I can be selective and not delete certain layers when purging but
    I'm wondering if there is a way to set up a drawing with protected layers so
    you can't delete them when you "purge all" even if they don't have objects.

    all good ideas given by others but another thought is to not worry about it
    and have a simple routine to restore all of your standard layers with the
    push of a button, or in my case RL (restore layers) on the keyboard. I hard
    purge everything when archiving drawings and often have the need to restore
    my standard layers purged during the process while doing revisions. I have a
    routine that checks for layer names and recreates them if they don't exist.
    Loads the proper linetypes, sets non plotting layers, etc. I'd be happy to
    share it if you would like it.
    Dave
    DDP

  7. #7
    Stephen R Guest
    That sounds like a useful routine. What version autocad is it written for?

    Stephen R.

    "Dave Jones" <spamless@nospam.com> wrote in message
    news:41abf7d9$1_3@newsprd01...
    "andy drafter" <nospam@address.withheld> wrote in message
    news:17178821.1101774909037.JavaMail.jive@jiveforu m2.autodesk.com...
    I'd like to be able to purge an entire drawing without deleting layers
    that have no objects. These layers may be used later in the drawing and I
    don't want to have to retype in layer names etc.

    I know I can be selective and not delete certain layers when purging but
    I'm wondering if there is a way to set up a drawing with protected layers
    so
    you can't delete them when you "purge all" even if they don't have
    objects.

    all good ideas given by others but another thought is to not worry about
    it
    and have a simple routine to restore all of your standard layers with the
    push of a button, or in my case RL (restore layers) on the keyboard. I
    hard
    purge everything when archiving drawings and often have the need to
    restore
    my standard layers purged during the process while doing revisions. I have
    a
    routine that checks for layer names and recreates them if they don't
    exist.
    Loads the proper linetypes, sets non plotting layers, etc. I'd be happy to
    share it if you would like it.
    Dave
    DDP

  8. #8
    Tom Smith Guest
    I hard purge everything when archiving drawings and often have the need to
    restore my standard layers purged
    I agree that having a standard-layer-fixing tool is handy, and I also use
    one for restoring layers in old drawings that have been excessively purged.
    But another way of looking at it is: why purge the layers anyway? Maybe the
    OP is leaning toward a more direct solution of not purging layers in the
    first place.

    A lot of people are adamant (not to say compulsive) about "hard purging"
    everything, but I don't know how often they really analyze what they're
    doing. Unused blocks can obviously contribute to grossly inflated file
    sizes. But none of the other purgeable items normally have any significant
    effect on file size or performance.

    We have an "empty" standard drawing which contains all of out standard
    layers (just over 40), a couple of text styles, the few linetypes we use,
    our two dimstyles, and so forth. It's 33.5K in size. Purging out the 40
    layers down to just layer "0" reduces it to 32.3K -- a grand total of 1.2K
    saved by purging. So an unused layer seems to contribute around 30 bytes to
    a drawing file. It takes several dozen of them to total a kilobyte. For an
    average completed drawing, a 1K difference in file size just doesn't matter
    to me. There's been considerably more difference than that from one version
    of Acad to the next.

    Given the negligible effect on file size, I don't think it's really worth
    anybody's time to purge layers at all, especially when there's a
    corresponding need to be able to restore them later. I advise our users to
    purge unused blocks, and to just not worry about anything else.

  9. #9
    Dave Jones Guest
    "Tom Smith" <nospam> wrote in message news:41ac78e7_3@newsprd01...
    I hard purge everything when archiving drawings and often have the need
    to
    restore my standard layers purged

    I agree that having a standard-layer-fixing tool is handy, and I also use
    one for restoring layers in old drawings that have been excessively
    purged.
    But another way of looking at it is: why purge the layers anyway? Maybe
    the
    OP is leaning toward a more direct solution of not purging layers in the
    first place.

    A lot of people are adamant (not to say compulsive) about "hard purging"
    everything, but I don't know how often they really analyze what they're
    doing. Unused blocks can obviously contribute to grossly inflated file
    sizes. But none of the other purgeable items normally have any significant
    effect on file size or performance.

    We have an "empty" standard drawing which contains all of out standard
    layers (just over 40), a couple of text styles, the few linetypes we use,
    our two dimstyles, and so forth. It's 33.5K in size. Purging out the 40
    layers down to just layer "0" reduces it to 32.3K -- a grand total of 1.2K
    saved by purging. So an unused layer seems to contribute around 30 bytes
    to
    a drawing file. It takes several dozen of them to total a kilobyte. For an
    average completed drawing, a 1K difference in file size just doesn't
    matter
    to me. There's been considerably more difference than that from one
    version
    of Acad to the next.

    Given the negligible effect on file size, I don't think it's really worth
    anybody's time to purge layers at all, especially when there's a
    corresponding need to be able to restore them later. I advise our users to
    purge unused blocks, and to just not worry about anything else.


    I hard purge simply for the simpilicity and speed of it. 90%+ of my archived
    drawings will never be seen again so only occasionally do I need to restore
    any defaults.
    Dave

  10. #10
    Dave Jones Guest
    originally 2000 and now works fine in 2005
    Dave
    "Stephen R" <srottloff@ nospam etcusa.com> wrote in message
    news:41ac7431$1_2@newsprd01...
    That sounds like a useful routine. What version autocad is it written
    for?

    Stephen R.

    "Dave Jones" <spamless@nospam.com> wrote in message
    news:41abf7d9$1_3@newsprd01...
    "andy drafter" <nospam@address.withheld> wrote in message
    news:17178821.1101774909037.JavaMail.jive@jiveforu m2.autodesk.com...
    I'd like to be able to purge an entire drawing without deleting layers
    that have no objects. These layers may be used later in the drawing and
    I
    don't want to have to retype in layer names etc.

    I know I can be selective and not delete certain layers when purging
    but
    I'm wondering if there is a way to set up a drawing with protected
    layers
    so
    you can't delete them when you "purge all" even if they don't have
    objects.

    all good ideas given by others but another thought is to not worry about
    it
    and have a simple routine to restore all of your standard layers with
    the
    push of a button, or in my case RL (restore layers) on the keyboard. I
    hard
    purge everything when archiving drawings and often have the need to
    restore
    my standard layers purged during the process while doing revisions. I
    have
    a
    routine that checks for layer names and recreates them if they don't
    exist.
    Loads the proper linetypes, sets non plotting layers, etc. I'd be happy
    to
    share it if you would like it.
    Dave
    DDP



  11. #11
    Tom Smith Guest
    Convenience definitely matters. In earlier versions we used a PUA (purge
    all) macro that ran the command-line version of purge several times.
    However, historically, at the same time the dialog came along which made the
    "all" option easier, there was also a new bug introduced.

    In 2000i, we had continual sporadic cases of drawing corruption which traced
    back to an intermittent bug in purging dimstyles. The drawings were always
    recoverable, but it was a major annoyance. The corruption wasn't bad enough
    to trigger an automatic recovery, just bad enough to make the drawing crash
    without warning. We skipped 2000 and 2002, so I don't know which other
    versions had the same bug. As long as you didn't purge dimstyles, no
    problem.

    Therefore I told our users to stop using the "all" option and just purge
    blocks. The nifty "purge all" button had cost quite a few hours in "help
    desk" time and lost drafting time without gaining us any discernible
    benefit.

    Purging blocks is still a one-button operation, just with a different option
    selected. I haven't seen the dimstyle purging bug in 2004, but still see no
    reason to change my instructions to the users. The only real reason to purge
    is to save file space, and blocks are the only purgeable item that makes any
    difference in that regard.

  12. #12
    C Witt Guest
    the only bit of code that you "should" need to change is noted in the
    lsp file.. is there another part you wanted to change?

    as to were to put it.. you can either place it in a file called
    acad.lsp (in one of your support paths, listed in cad).. or put the file
    I gave you, in one of those paths and have it auto loaded (via one of
    your companies other lisp files (if you use lisp files). or a very
    basic per use method of "drag and drop" the file into cad (whenever you
    want to use it).

    if you do a search of the customization newsgroups you should be able to
    find more than enough documentation on the first two methods.

  13. #13
    Casey Roberts Guest
    Reducing file size is not the only reason to purge a drawing. I personally,
    would rather not sift through 200 layers in the dialog box when only 40 are
    used. Same with dimension styles, text styles etc.

    Another reason may be proprietary blocks / information that you don't want
    to send when you distribute the files. (Engineers stamps etc...)

    Now if only purge included layer filters as an option... that can also
    reduce file size substantially. (for now I'll stick with my lisp)

    Just my 2 cents

    Casey

    "Tom Smith" <nospam> wrote in message news:41ac8fe1_2@newsprd01...
    Convenience definitely matters. In earlier versions we used a PUA (purge
    all) macro that ran the command-line version of purge several times.
    However, historically, at the same time the dialog came along which made
    the
    "all" option easier, there was also a new bug introduced.

    In 2000i, we had continual sporadic cases of drawing corruption which
    traced
    back to an intermittent bug in purging dimstyles. The drawings were always
    recoverable, but it was a major annoyance. The corruption wasn't bad
    enough
    to trigger an automatic recovery, just bad enough to make the drawing
    crash
    without warning. We skipped 2000 and 2002, so I don't know which other
    versions had the same bug. As long as you didn't purge dimstyles, no
    problem.

    Therefore I told our users to stop using the "all" option and just purge
    blocks. The nifty "purge all" button had cost quite a few hours in "help
    desk" time and lost drafting time without gaining us any discernible
    benefit.

    Purging blocks is still a one-button operation, just with a different
    option
    selected. I haven't seen the dimstyle purging bug in 2004, but still see
    no
    reason to change my instructions to the users. The only real reason to
    purge
    is to save file space, and blocks are the only purgeable item that makes
    any
    difference in that regard.

  14. #14
    Robert Crenshaw Guest
    Dave,

    Would you post that routine? I think that would be something we could use
    here to standardize our drawings or so guys aren't asking things like "What
    kind of line do we use for contours?..." all the time.

    Thanks in advance....

    Rob

    "Make the rest of your life the best of your life."


    "Dave Jones" <spamless@nospam.com> wrote in message
    news:41abf7d9$1_3@newsprd01...
    "andy drafter" <nospam@address.withheld> wrote in message
    news:17178821.1101774909037.JavaMail.jive@jiveforu m2.autodesk.com...
    I'd like to be able to purge an entire drawing without deleting layers
    that have no objects. These layers may be used later in the drawing and I
    don't want to have to retype in layer names etc.

    I know I can be selective and not delete certain layers when purging but
    I'm wondering if there is a way to set up a drawing with protected layers
    so
    you can't delete them when you "purge all" even if they don't have
    objects.

    all good ideas given by others but another thought is to not worry about
    it
    and have a simple routine to restore all of your standard layers with the
    push of a button, or in my case RL (restore layers) on the keyboard. I
    hard
    purge everything when archiving drawings and often have the need to
    restore
    my standard layers purged during the process while doing revisions. I have
    a
    routine that checks for layer names and recreates them if they don't
    exist.
    Loads the proper linetypes, sets non plotting layers, etc. I'd be happy to
    share it if you would like it.
    Dave
    DDP

  15. #15
    Dave Jones Guest
    "Robert Crenshaw" <crenshaw@nmbsc.net> wrote in message
    news:41b08b42_3@newsprd01...
    Dave,

    Would you post that routine? I think that would be something we could use
    here to standardize our drawings or so guys aren't asking things like
    "What
    kind of line do we use for contours?..." all the time.

    Thanks in advance....

    Rob

    "Make the rest of your life the best of your life."

    here ya go...not elegant but it works :)
    Dave

    (defun C:RL ()

    (setq savcmd (getvar "CMDECHO"))
    (setq savlay (getvar "CLAYER"))
    (setvar "CMDECHO" 0)

    ;load required LTYPEs if not already loaded
    (if (not (tblsearch "LTYPE" "CENTER"))
    (command "LINETYPE" "LOAD" "CENTER" "" "")
    );end if
    (if (not (tblsearch "LTYPE" "HIDDEN"))
    (command "LINETYPE" "LOAD" "HIDDEN" "" "")
    );end if

    ;check to see if the layer exists and if not create it
    (defun create_layer (layr color on_off lttype / layr color on_off lttype)
    (cond
    ((=(tblobjname "layer" layr) nil)
    (entmake
    (list
    '(0 . "LAYER")
    '(100 . "AcDbSymbolTableRecord")
    '(100 . "AcDbLayerTableRecord")
    (cons 2 layr)
    (cons 70 on_off)
    (cons 62 color)
    (cons 6 lttype)
    )
    )
    );END EQ
    (T
    (setq layr(entget(tblobjname "layer" layr))
    layr(subst(cons 62 color)(assoc 62 layr)layr)
    layr(subst(cons 70 on_off)(assoc 70 layr)layr)
    layr(subst(cons 6 lttype)(assoc 6 layr)layr))
    (entmod layr)
    (entupd (cdr(assoc -1 layr)))
    );end t
    );end cond
    (princ)
    );end create_layer

    ;Layer list
    (defun RestoreLayers ()
    (create_layer "ALUM" 15 0 "CONTINUOUS")
    (create_layer "BORDER" 5 0 "CONTINUOUS")
    (create_layer "CENTER" 9 0 "CENTER")
    (create_layer "CLAD" 161 0 "CONTINUOUS")
    (create_layer "CONST" 2 0 "CONTINUOUS")
    (create_layer "CW" 7 0 "CONTINUOUS")
    (create_layer "DIMN" 7 0 "CONTINUOUS")
    (create_layer "ELEV" 220 0 "CONTINUOUS")
    (create_layer "FAST" 4 0 "CONTINUOUS")
    (create_layer "GLS" 1 0 "CONTINUOUS")
    (create_layer "GRID" 54 0 "CONTINUOUS")
    (create_layer "GSKT" 1 0 "CONTINUOUS")
    (create_layer "HATCH" 9 0 "CONTINUOUS")
    (create_layer "HIDDEN" 9 0 "HIDDEN")
    (create_layer "NOTES" 120 0 "CONTINUOUS")
    (create_layer "PARTNO" 3 0 "CONTINUOUS")
    (create_layer "PLAN" 230 0 "CONTINUOUS")
    (create_layer "SEAL" 20 0 "CONTINUOUS")
    (create_layer "SECT" 240 0 "CONTINUOUS")
    (create_layer "STEEL" 185 0 "CONTINUOUS")
    (create_layer "SYMBOL" 123 0 "CONTINUOUS")
    (create_layer "VIEWPORT" 7 0 "CONTINUOUS")
    (create_layer "WP" 1 0 "CONTINUOUS")
    (create_layer "WW" 4 0 "CONTINUOUS")
    );end defun RestoreLayers

    (RestoreLayers)

    ;set no plot layers
    (command "LAYER" "S" "VIEWPORT" "P" "NO" "VIEWPORT" "")

    (setvar "CMDECHO" savcmd)
    (setvar "CLAYER" savlay)
    (princ)

Page 1 of 2 12 LastLast

Similar Threads

  1. what isolate layers in layers do ?
    By prasath in forum Pro/Engineer
    Replies: 1
    Last Post: 01-24-2005, 12:51 AM
  2. layers vs "standards"
    By Paul Caruthers in forum Drafting
    Replies: 6
    Last Post: 01-21-2005, 02:49 PM
  3. Example Dbx and layers...
    By Rudy Tovar in forum Customization
    Replies: 0
    Last Post: 01-11-2005, 07:05 PM
  4. PURGING AN SHX FILE
    By The Real JD in forum AutoCAD
    Replies: 3
    Last Post: 12-13-2004, 09:53 PM
  5. Deleting Layers
    By Sebastian Interns in forum AutoCAD
    Replies: 5
    Last Post: 09-22-2004, 11:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other forums: Access Forum - Microsoft Office Forum - Exchange Server Forum