NOT purging layers
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
NOT purging layers
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Drafting
Author Message
andy drafter
Guest





Posted: Tue Nov 30, 2004 5:34 am    Post subject: NOT purging layers Reply with quote

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.

Back to top
Paul Turvill
Guest





Posted: Tue Nov 30, 2004 5:47 am    Post subject: Re: NOT purging layers Reply with quote

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@jiveforum2.autodesk.com...
Quote:
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.
Back to top
C Witt
Guest





Posted: Tue Nov 30, 2004 6:17 am    Post subject: Re: NOT purging layers Reply with quote

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


Back to top
andy drafter
Guest





Posted: Tue Nov 30, 2004 7:02 am    Post subject: Re: NOT purging layers Reply with quote

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.
Back to top
Dean Saadallah
Guest





Posted: Tue Nov 30, 2004 7:15 am    Post subject: Re: NOT purging layers Reply with quote

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
--
Back to top
Dave Jones
Guest





Posted: Tue Nov 30, 2004 9:30 am    Post subject: Re: NOT purging layers Reply with quote

"andy drafter" <nospam@address.withheld> wrote in message
news:17178821.1101774909037.JavaMail.jive@jiveforum2.autodesk.com...
Quote:
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.
Quote:

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
Back to top
Stephen R
Guest





Posted: Tue Nov 30, 2004 6:18 pm    Post subject: Re: NOT purging layers Reply with quote

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...
Quote:
"andy drafter" <nospam@address.withheld> wrote in message
news:17178821.1101774909037.JavaMail.jive@jiveforum2.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

Back to top
Tom Smith
Guest





Posted: Tue Nov 30, 2004 6:43 pm    Post subject: Re: NOT purging layers Reply with quote

Quote:
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.
Back to top
Dave Jones
Guest





Posted: Tue Nov 30, 2004 7:59 pm    Post subject: Re: NOT purging layers Reply with quote

"Tom Smith" <nospam> wrote in message news:41ac78e7_3@newsprd01...
Quote:
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
Back to top
Dave Jones
Guest





Posted: Tue Nov 30, 2004 7:59 pm    Post subject: Re: NOT purging layers Reply with quote

originally 2000 and now works fine in 2005
Dave
"Stephen R" <srottloff@ nospam etcusa.com> wrote in message
news:41ac7431$1_2@newsprd01...
Quote:
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@jiveforum2.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



Back to top
Tom Smith
Guest





Posted: Tue Nov 30, 2004 8:21 pm    Post subject: Re: NOT purging layers Reply with quote

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.
Back to top
C Witt
Guest





Posted: Tue Nov 30, 2004 9:44 pm    Post subject: Re: NOT purging layers Reply with quote

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.
Back to top
Casey Roberts
Guest





Posted: Wed Dec 01, 2004 12:02 am    Post subject: Re: NOT purging layers Reply with quote

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

Back to top
Robert Crenshaw
Guest





Posted: Fri Dec 03, 2004 8:50 pm    Post subject: Re: NOT purging layers Reply with quote

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...
Quote:
"andy drafter" <nospam@address.withheld> wrote in message
news:17178821.1101774909037.JavaMail.jive@jiveforum2.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

Back to top
Dave Jones
Guest





Posted: Fri Dec 03, 2004 10:25 pm    Post subject: Re: NOT purging layers Reply with quote

"Robert Crenshaw" <crenshaw@nmbsc.net> wrote in message
news:41b08b42_3@newsprd01...
Quote:
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)
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Drafting All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB