;;LPURGE.LSP Copyright 1998,2003 HyperPics all rights reserved
;;
;; Author: Lee Ambrosius,
;; HyperPics [URL unfurl="true"]http://www.hyperpics.com[/URL]
;;Updated 6/21/03
;;Version 1.3 Works correctly with R12 - 2004
;;
;;Updated 8/15/98
;;Version 1.2 Only Works for R12, R13 & R14
;;
;;Last purge command you will ever need
;;This Lisp routine is in replacement or in addition to
;;the standard PURGE Command. This command will automatically
;;purge everything for you.
;;Place this in your ACAD.Lsp routine or in it's own file.
;;Once it's loaded just type LPURGE.
(prompt "\nEnter LPURGE or LP to run routine.")
(terpri)
(defun c:LPURGE (/ VR TYP CMD EXIT)
(initget 1 "Blocks, Dimstyles, LAyers, LTypes, SHapes, Styles, Mlinestyles,
All")
(setq TYP (getkword "\nPurge unused
Blocks/Dimstyles/LAyers/LTypes/SHapes/STyles/Mlinestyles/All: "))
(setq VR (getvar "ACADVER"))
(setq VR (substr VR 1 2))
(if (or (= VR "12")(= VR "13"))
(progn
(setq EXIT "FALSE")
(while (= EXIT "FALSE")
(command "._PURGE" TYP)
(setq EXIT "TRUE")
(while (not (zerop (getvar "CMDACTIVE")))
(command "Y")
(setq EXIT "FALSE")
)
)
(princ)
)
(progn
(setq EXIT "FALSE")
(while (= EXIT "FALSE")
(command "._PURGE" TYP "*" "Y")
(setq EXIT "TRUE")
(while (not (zerop (getvar "CMDACTIVE")))
(command "Y")
(setq EXIT "FALSE")
)
)
(princ)
)
)
(princ)
(prompt "\nLast Purge complete.")
)
(princ)
;; Also a type-in command for LPURGE
(defun c:LP ()
(c:LPURGE)
(princ)
)
(princ)
;-----------------LPURGE.Lsp------------------------ -------------