Author Topic: Purging drawings without opening  (Read 3849 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
Purging drawings without opening
« on: November 30, 2004, 10:17:36 AM »
i am trying to clean up our library by purging all of the drawings. what i'd like to do is open all files in a given directory and purge them then close. I am trying to use this script and run it using ezscript but it's not doing it for some reason. here's my script:

;Open
open
;
;Purge all
Purge
;
all
;
*
;
n
;
save
;
exit
;;end of script

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Purging drawings without opening
« Reply #1 on: November 30, 2004, 10:41:32 AM »
Dan, The title of this thread says "Lisp help" But your question doesn't have anything to do with a lisp.

Could you please rename this thread to something a little more descriptive to your problem? (and don't just name it "script help" either! We are attempting to eliminate non-descriptive thread titles. TheSwamp is a database of information, we would like to keep the information as search able as possible.)

Thanx man.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Purging drawings without opening
« Reply #2 on: November 30, 2004, 10:43:45 AM »
Dan, have you tried using VBA? It is so much better at that kind of stuff....
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

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Purging drawings without opening
« Reply #3 on: November 30, 2004, 11:14:00 AM »
*sigh* ...I guess i deserved that.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

ronjonp

  • Needs a day job
  • Posts: 7529
Purging drawings without opening
« Reply #4 on: November 30, 2004, 11:15:39 AM »
Quote
Dan, have you tried using VBA? It is so much better at that kind of stuff....


Something like this Dan:

-vbarun
thisdrawing.purgeall
qsave
close

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ELOQUINTET

  • Guest
Purging drawings without opening
« Reply #5 on: November 30, 2004, 12:54:26 PM »
not that comfortable with vba yet. i don't really get the interface. how do i create a new routine or whatever you call it in vba. i have trev's gatte vba open and am looking at it but don't quite get the terms and format?

ronjonp

  • Needs a day job
  • Posts: 7529
Purging drawings without opening
« Reply #6 on: November 30, 2004, 03:07:25 PM »
Dan,

Use the script I posted above. It should work for you.

Ron
     
Code: [Select]
-vbarun
thisdrawing.purgeall
qsave
close

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Serge J. Gianolla

  • Guest
Purging drawings without opening
« Reply #7 on: November 30, 2004, 06:55:32 PM »
This is taken from David Stein, Example3.lsp:
Code: [Select]
;; This example involves the task of iterating through the Documents collection
;; and performing a Purge, Audit and Save operation on each document.

(defun C:DOALL ( / $acad docs dnum this)
  (setq $acad (vlax-get-acad-object)
        docs (vla-get-documents $acad)
        this (vla-get-activedocument $acad)
        dnum (vla-get-count docs)
  )
  (vlax-for each docs
    (vla-purgeall each)
    (vla-auditinfo each T)
    (vla-save each)
  )
  (vla-get-activedocument this)
  (vlax-release-object docs)
  (vlax-release-object this)
  (vlax-release-object $acad)
  (princ (strcat "\nProcessed " (itoa dnum) " drawings."))
  (princ)
)

Ron Heigh

  • Guest
Purging drawings without opening
« Reply #8 on: November 30, 2004, 11:54:09 PM »

ELOQUINTET

  • Guest
Purging drawings without opening
« Reply #9 on: December 02, 2004, 09:49:03 AM »
man that's sweeeet ron thank you very much