Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Automatic PURGING via AutoLisp???

825 views
Skip to first unread message

Matt Fetterley

unread,
Jul 27, 1996, 3:00:00 AM7/27/96
to

Ok, here's the deal, I've got a LOT of old drawings, done by some geek who
got off on having 200 different layers, and never purging his deleted
blocks, shapes, styles, etc...

Is there anyone fluent in AutoLisp that can write me a short Lisp routine
towards automating the purge process, ie:

purge
all
y
y
y
y
y... <repeat>

Any help would be greatly appreciated.

Thanks,
Shadow

Roy Minut

unread,
Jul 28, 1996, 3:00:00 AM7/28/96
to Matt Fetterley
> ShadowAbout 4-5 months ago (I can't place the exact issue) Cadence magazine
had a purgeall command published in the "tips and tricks" section, the
last page most of the time. I have used it with R13c4 the only thing I
don't like about it is that it behaved like R12 in that no changes could
be made to the drawing prior to using it. Works well I might add.
Roy Minut
rmi...@cris.com

PS: I have the article around here someplace and a copy on my hard disk,
(somewhere in amongst 950 megabyte of data), if you send me e-mail I
will find it an e-mail a copy.

Rod Young

unread,
Jul 28, 1996, 3:00:00 AM7/28/96
to Matt Fetterley

Matt Fetterley wrote:
>
> Ok, here's the deal, I've got a LOT of old drawings, done by some geek who
> got off on having 200 different layers, and never purging his deleted
> blocks, shapes, styles, etc...
>
> Is there anyone fluent in AutoLisp that can write me a short Lisp routine
> towards automating the purge process, ie:
>

Matt,

Our program RUN LISP incluldes (among many others) a program to
autopurge drawings in batch mode. See the end of the this message for
downloadable demos.

AutoCad automation programs available from Sierra Hermitage:

**** RUN LISP (TM) Sierra Hermitage

Featured in March, 1996 issue of CADENCE magazine.

A program that enables you to batch process AutoCad drawings. Run any
AutoLisp or script programs across multiple drawings AUTOMATICALLY. Use
it to automatically batch plot to files - purge - automate changes.
Choose multiple drawings from multiple subdirectories and multiple
AutoLisp programs from multiple subdirectories.

WHATEVER YOU NEED! ON AS MANY DRAWINGS AS YOU SELECT.

As you know, AutoCad sets all AutoLisp programs and variables to nil
each time a new drawing is loaded and therefor an AutoLisp routine
cannot run across multiple drawings. RUN LISP solves that problem with
ease!

RUN LISP can run BOTH AutoLisp and script files in BOTH Windows and DOS
AutoCad.

The Windows interface for RUN LISP is an AutoCad for Windows Rel 12 or
13 and Windows 3.1 - Win 95 - NT compatible program to run AutoLisp and
script program across multiple drawings.

The Windows interface for RUN LISP provides a standard file dialogue box
where you can select the drawings to be processed and the AutoLisp
programs to be run within each. It's that simple - just make your
selections and kick back while RUN LISP does the work.

The following sample AutoLisp programs are provided with RUN LISP to do
batch processing:

ABKOUT function to wblock all blocks within a drawing

Can be used with ASLDLIB.LSP and RUN LISP to automatically create a
slide of each drawing and build the slide list file required as an
argument by SLIDELIB.EXE to create a slide library.

ASLDLIB function to automatically create slides of drawings and a text
file that can be used with SLIDLIB.EXE to create a slide library.
SLIDELIB.EXE is a utility supplied with AutoCad, see your AutoCad
documentation.

Can be used with ABKOUT.LSP to create a slide library of all blocks
within multiple drawings.

ADXFOUT.LSP program to write dxf files in ascii format.

ADXOUTB.LSP program to write dxf files in ascii format.

AUTOPURG.LSP is an autolisp program to automatically purge unused
layers, blocks, linetypes, text style, etc from drawings.

AUTOPLOT program to plot drawings to plot files.

PSTAMP program to stamp drawings with current values of system variables
including DATE, DRAWING NAME & PATH, LOGIN NAME and LTSCALE. Others may
be added if desired. Use this with AUTOPLOT to date stamp your plots.

DWGTIME.LSP program to write out a report of drawing times for drawings,
including the creation date/time, last update date/time and total time
spent on the drawing. The file is space deliminated so that it can be
imported into other programs.

FONTSUB function to change fonts within a drawing.

SHIP.LSP program to clean up drawings before shipping to other parties.
Handles the common problems of incompatible fonts, system setting, layer
names, external references and zoom level.

ACONVERT to convert R13 drawings to R12 from within AutoCad R13.

RUNSCR to run script files.

ATTRSTYL to change style of block attributes.

ASAVEIMG to save drawing as TIF, GIF or TGA image file.

**** BATCH PLOT (TM) Sierra Hemitage

BATCH PLOT is a specialized version of RUN LISP to handle plotting
only. It allows you to plot directly to the printer/plotter instead of
to plot files.

**** AUTODXF (TM) Sierra Hermitage

AUTODXF is a Windows 3.1/95/NT and AutoCad Windows R12/R13 compatible
program to automatically convert DXF files into AutoCad drawings from
within AutoCad in unattended batch mode. The DXF files may be selected
from multiple subdirectories and up to 1,000 may be processed at one
time. The program provides for further manipulation of the drawing
prior to saving, if desired. Each DXF file may be converted and saved
as a separate drawing or all may be combined into one drawing.

AutoDXF provides a standard file dialog box from which to choose the DXF
files to be converted.

AutoDXF is NOT simply a script file generator.

**** DWGDOC (TM) Sierra Hermitage

DWGDOC is an AutoCad Rel 11, Rel 12 and R13 DOS or WINDOWS compatible
program to create text files as an integral part of a drawing. The text
files become an invisible part of the drawing so that you don't have to
worry about it getting lost. The text files are fully editable using
the editor of your choice and the next line in the file is automatically
date/time stamped whenever you edit the file. All it takes to open the
file is one command. The file can be of any size and include any kind
of text you wish, so it can be used to make notes such as plotting
instructions, who did what - when, the drawing's status, charges against
the drawings or anything else you wish. Use it to document the drawing,
direct coworkers on required revisions. The uses are unlimited.

DWGDOC also provides AutoLisp functions so that you can write/read
DWGDOC compatible files in your own AutoLisp programs. A functional
AutoLisp program, SAVLAY.LSP is provided as an example. SAVLAY.LSP
saves/restores an unlimited number of current layer setting sets with
the drawings.

*** AUTO BMP (TM) Sierra Hermitage

AUTO BMP is an AutoCad for Windows Rel 12 or 13 and Windows 3.1 - Win 95
& NT compatible program to create bitmap files (.bmp) from multiple
drawings automatically. Pick drawings to process from the standard
dialog box and let AUTO BMP do the work. No batch files to prepare or
AutoLisp to program.

***AUTOLISP LOADER (ALOAD) VER 2.0 (TM) Sierra Hermitage

ALOAD is an AutoCad for Windows R12 or R13 and Windows 3.1 and Win 95
compatible utility to help manage and load AutoLisp programs.

ALOAD provides the following features not offered by AutoCad's appload
dialog box:

1) Editing of the AutoLisp program. This is especially useful in
writing programs by allowing you to cycle through the edit/load/run
debugging sequence easily. It also allows you to quickly add comment
lines to a program as a reminder of its function.

You may use NotePad or set the default to an editor of your choice.

2) Reload the current set of AutoLisp programs in the next drawing you
open. You can also save the current set of AutoLisp programs for
reloading the next time start you up AutoCad or to build a library of
programs.

3) Unlimited libraries of related AutoLisp programs. Any AutoLisp
program may be added to (or deleted from) any library to allow you to
easily load those programs needed for the type of work you are currently
doing. You may have separate libraries for different tasks like
mechanical, civil, architecture, general, etc and load just the
libraries you need instead of wasting memory.

4) View the list of programs in any library or print out a list of
programs included within a library along with their description as
contained in the beginning comment lines. You can quickly make all of
your AutoLisp programs self documenting.

5) Scroll through a list of your AutoLisp programs and view their
descriptions as contained in the beginning comment lines.

**** FINDVARS (TM) Sierra Hermitage

Featured in March, 1996 issue of CADENCE magazine.

FINDVARS is a Windows program to aid in AutoLisp programming. Simply
copy your program to the clipboard and paste into FINDVARS and it will
display a list of all setq and set variables in alphabetical order. You
may then copy those variables to the clipboard in a format ready to
paste into your code's defun statement to declare the variable as local.
FINDVARS handles nested setq's and set's to any level and multiple
setq's and set's.

FINDVARS helps in two ways:

Misspelled variables are the hardest program bugs to trace down because
an error is seldom generated. By seeing your variables in alphabetical
order, it is easy to spot those errors.

Many AutoLisp programmers leave their variables defined as global
because of the effort it takes to assemble a list of those variables.
FINDVARS prepares the list for you in a flash in a string formated
correctly to just paste into your code to declare them local.
ie (defun myprog( / pastehere)

By declaring your variables as local you avoid possible problems with
uninitialized variables because we all tend to reuse variable names.

ORDERING INFORMATION:

To order any of the above programs, fax your PO or your order request on
company letterhead to 619-387-2488 or send payment to:

Sierra Hermitage
140 Mesa Vista Drive
Bishop, CA 93514

Phone: 619-387-2479
Fax: 619-387-2488
Email: her...@ix.netcom.com

PRICE LIST - (Calif. residents add 7.75% sales tax)

INDIVIDUAL PROGRAMS - S&H - $5 for first program, $1 for each
additional program (by U.S. Mail)
RUN LISP $25
BATCH PLOT $25
DWGDOC $25
AUTOBMP $15
ALOAD $25
FINDVARS $10
AUTODXF $25 - NEW PROGRAM-Add $20 to Package #1 or #2
to include AUTODXF
PACKAGE DEALS - GREAT SAVINGS

PACKAGE # 1 - $79 Plus $10 S&H (by U.S. Mail)
Includes all programs listed under Individual Programs
(EXCEPT AUTODXF).

PACKAGE #2 - $59 Plus $8 S&H (by U.S. Mail)
RUN LISP
DWGDOC
ALOAD
AUTO BMP

Within United States: Express shipping via UPS blue label is $15 total.

Email uploads are $10 per program - plus normal shipping if you also
want the program sent to you.

Outside United States (U.S. Mail only): - Add $10 to above shipping
costs.

--

Sierra Hermitage Try our Acad automation products:
RUN LISP - batch acad
<ftp://ftp.coast.net/SimTel/win3/cad/rlisp2.zip>
BATCH PLOT - auto plot dwgs
<ftp://ftp.coast.net/SimTel/msdos/autocad/autoplot.zip>
AUTO LOADER - alisp manage
<ftp://ftp.coast.net/SimTel/win3/cad/aload20a.zip>
AUTOBMP - dwg > bmp
<ftp://ftp.coast.net/SimTel/msdos/autocad/autobmp2.zip>
DWGDOC - attach file to dwg
<ftp://ftp.coast.net/SimTel/msdos/autocad/dwgdocm.zip>
FINDVARS - alisp helper
<ftp://ftp.coast.net/SimTel/win3/cad/fvars2.zip>

Patrick Hughes

unread,
Jul 28, 1996, 3:00:00 AM7/28/96
to

Hi Matt,
While not an automated process I use this approach which is very
effective in purging all unused layers, linetypes, etc. : open the target
drawing(s), issue "wblock" command, respond with
same drawing name which you just opened, answer yes to replace, type * and
enter (this wblocks everything in the drawing except aforementioned). Open
next drawing (if prompted to save any changes (this occurrs if you have
changed menus or whatever) answer no.

At least you wont have to type all those y's again and again.

--
Pat Hughes

Engineered Design Solutions
duhv...@rockford.com

> "Matt Fetterley" <mfsh...@outpostmn.com> wrote in article
<01bb7bee$173e1c80$65e50ace@Shadow>...


> Ok, here's the deal, I've got a LOT of old drawings, done by some geek
who
> got off on having 200 different layers, and never purging his deleted
> blocks, shapes, styles, etc...
>
> Is there anyone fluent in AutoLisp that can write me a short Lisp
routine
> towards automating the purge process, ie:
>

Robert S. Carroll

unread,
Jul 29, 1996, 3:00:00 AM7/29/96
to

"Matt Fetterley" <mfsh...@outpostmn.com> wrote:

>Ok, here's the deal, I've got a LOT of old drawings, done by some geek who
>got off on having 200 different layers, and never purging his deleted
>blocks, shapes, styles, etc...

>Is there anyone fluent in AutoLisp that can write me a short Lisp routine
>towards automating the purge process, ie:

>purge
>all
>y
>y
>y
>y
>y... <repeat>

>Any help would be greatly appreciated.

>Thanks,
>Shadow

Matt,

Here is a short routine (which can be run via a script file for a directory full
of drawings) which will purge a drawing. It was written by Vladimir Nesterovsky
and is a slick little routine.

(I use a lisp routine called SWEEP.LSP which will create a script file to purge
the drawings in a directory. E-mail me if you need more info.)

;;; by Vladimir Nesterovsky
(defun c:prgall (/ )
(command ".purge" "all")
(while
(= 1 (logand (getvar "cmdactive") 1))
(command "y")
);end while
(princ)
);end prgall.lsp


Sincerely,
Robert S. Carroll
rsc...@ix.netcom.com


de_m...@dds.nl

unread,
Jul 29, 1996, 3:00:00 AM7/29/96
to

Roy Minut <rmi...@concentric.net> wrote:

{:> Matt Fetterley wrote:
{:> >
{:> > Ok, here's the deal, I've got a LOT of old drawings, done by some geek
who
{:> > got off on having 200 different layers, and never purging his deleted
{:> > blocks, shapes, styles, etc...
{:> >
{:> > Is there anyone fluent in AutoLisp that can write me a short Lisp
routine
{:> > towards automating the purge process, ie:
{:> >
{:> > purge
{:> > all
{:> > y
{:> > y
{:> > y
{:> > y
{:> > y... <repeat>
{:> >
{:> > Any help would be greatly appreciated.
{:> >
{:> > Thanks,

{:> > ShadowAbout 4-5 months ago (I can't place the exact issue) Cadence


magazine
{:> had a purgeall command published in the "tips and tricks" section, the
{:> last page most of the time. I have used it with R13c4 the only thing I
{:> don't like about it is that it behaved like R12 in that no changes could
{:> be made to the drawing prior to using it. Works well I might add.
{:> Roy Minut
{:> rmi...@cris.com

{:> PS: I have the article around here someplace and a copy on my hard disk,
{:> (somewhere in amongst 950 megabyte of data), if you send me e-mail I
{:> will find it an e-mail a copy.


Try something like this:

(command "_purge" "a")(while (cmdactive=1)(command "y")

I do not remember the exact syntaxis right now.
I am building something in w95 to purge a larger selection of files. The *.lsp
is working fine. Purges 3 times and inserts a start.dwg to get the layers,
dimstiles etc you want to have even if you do not use them. If tou like to I
can give you a copy. I have the file at work.

Greetings & succes, marco.
_____________________________________________________________________
Marco van Schagen, Alkmaar, NL; de_m...@dds.nl
(this is my signature) coming home at http://www.dra.nl/~marco
_____________________________________________________________________


Bruce Feuchuk

unread,
Jul 30, 1996, 3:00:00 AM7/30/96
to

With Deft Fingers, "Matt Fetterley" <mfsh...@outpostmn.com> wrote:

>Is there anyone fluent in AutoLisp that can write me a short Lisp routine
>towards automating the purge process, ie:

Here is a Lisp routine that you can use. It prompts you for How many
times you want to run the purge (sometimes this is needed to fully rid
your drawing of excess weight). This routine Purges 'everything'
unused ---> layers, blocks, styles, linetypes, etc. (you could
probably modify it to "only" do layers):

;AutoPurg.lsp J.M.Varch 02/02/96
;Repetetive purge command

(prompt "\nType AP to start AutoPurge")
(defun c:AP ()
(setq times (atoi (getstring "\nPurge how many times? ")))
(repeat times
(command "purge" "a" )
(while (= (getvar "CMDNAMES") "PURGE")


(command "y" )
);end while

)
(princ)
) ;defun


Regards,
Bruce

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I just got a new car for my girlfriend... Great trade...
(live from the West End of Vancouver, B.C. Canada)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


de_m...@dds.nl

unread,
Aug 4, 1996, 3:00:00 AM8/4/96
to

de_m...@dds.nl wrote:

Instead wblocking your dwg, you'd better purge, say 3 times like I mentioned.

When you are using w95 and acad 13, you can even easily purge by selecting the
dwg's in any w95 folder, right-click and select purge. You need to install the
files given in my message "acadr13 / w95 autopurge". Free. Make sure you read
the text and make the customalisation. All is still in a test fase.

You will find there a lisproutine that preforms the task. You may want to use
only that lisp. As you wish.

Succes & greetings.

_____________________________________________________________________
Marco van Schagen, Alkmaar, NL; de_m...@dds.nl

http://www.dra.nl/~marco
_____________________________________________________________________
Een koe is ook maar een beest al is hij zwart en wit tegelijk.


rev...@gnn.com

unread,
Aug 13, 1996, 3:00:00 AM8/13/96
to

begin 644 purge.exe
<uuencoded_portion_removed>

rev...@gnn.com

unread,
Aug 13, 1996, 3:00:00 AM8/13/96
to

"Matt Fetterley" <mfsh...@outpostmn.com> wrote:

>Ok, here's the deal, I've got a LOT of old drawings, done by some geek who
>got off on having 200 different layers, and never purging his deleted
>blocks, shapes, styles, etc...

>Is there anyone fluent in AutoLisp that can write me a short Lisp routine
>towards automating the purge process?

Not that I know of but I have a small utility for DOS that can purge
ACAD drawings by tagging or selecting all in a directory. It reduces
to the same size as ACAD will. I checked it with R12.

rev...@gnn.com

unread,
Aug 18, 1996, 3:00:00 AM8/18/96
to

"Matt Fetterley" <mfsh...@outpostmn.com> wrote:

>Ok, here's the deal, I've got a LOT of old drawings, done by some geek who
>got off on having 200 different layers, and never purging his deleted
>blocks, shapes, styles, etc...

>Is there anyone fluent in AutoLisp that can write me a short Lisp routine

>towards automating the purge process, ie:

>purge
>all

>Any help would be greatly appreciated.

>Thanks,
>Shadow

After responding to this message last time I got flooded with requests
for the purging utility I spoke of, so.....
here it is.


rev...@gnn.com

unread,
Aug 18, 1996, 3:00:00 AM8/18/96
to

begin 644 purge.zip
<uuencoded_portion_removed>

rev...@gnn.com

unread,
Aug 18, 1996, 3:00:00 AM8/18/96
to

<uuencoded_portion_removed>
%$0$```#B
`
end

DAVID3395

unread,
Aug 19, 1996, 3:00:00 AM8/19/96
to

In article <4v88uk$2...@news-e2b.gnn.com>, rev...@gnn.com writes:

>After responding to this message last time I got flooded with requests
>for the purging utility I spoke of, so.....
>here it is.
>
>

>Revhead:

Purge.zip is a very large file to automate Purge All. It came down as two
files.
Would you give some hints on how to patch these two binary files together,
what this program does and how to use it?
Thank you for your help;

David


DAVI...@aol.com David Childers, ASLA

Roy Minut

unread,
Aug 20, 1996, 3:00:00 AM8/20/96
to DAVID3395

If you are using Autocad R13, the very last page of the current issue of
Cadence magazine has a simple 3 liner purgeall command. I hhaven't
tried it yet but looks like it will do the job!

Roy Minut
rmi...@cris.com

0 new messages