;;; purge all in order of preference
(foreach x
(list "BLOCK" "MLINESTYLE" "Tablestyles" "LAYER" "DIMSTYLE" "STYLE" "LTYPE" "PLOTSTYLES" "Visualstyles" "MATERIALS") (SAA_PurgeAll x nil)
) ;_foreach
(SAA_PurgeAll "GROUP" "`*A*")
)
;;;============================================================================
;;; repeat purges passed in purge type
;;; nil = all
;;; use singular form, ex. "block" not "blocks"
;;; options: block, dimstyle, layer, ltype, plotstyle, shape, textstyle, mlinestyle, all
;;;
;;; modified from
;;; From: Cliff Middleton (cmiddleton@generalbroach.com)
;;; Subject: Re: Can Lisp determine if purge is required?
;;; Newsgroups: autodesk.autocad.customization
;;; Date: 2002-08-01 13:00:33 PST
;;;
;;; I like it, Mark. You may have found the graille (SP?). Here's my version.
;;;============================================================================
(defun SAA_PurgeAll
(ptype mask
/ tcnt cnt purgeall_aux
) )
(if (not ptype
)(setq ptype
"All")) ;trap for purge type (defun purgeall_aux
(/ cnt
) (command "._PURGE" ptype mask
"Yes") ; (command "._PURGE" ptype "~*`**" "Yes") ;don't purge anonymous blocks
cnt
) ;_ defun
(SETV "cmdecho" 0)
(if (= 9999 tcnt
)(progn (princ "\nQuitting at 9999 purges")(setq tcnt
0))) ;trap for endless loops (RSETV "cmdecho")
") "
"item"
ptype
)
"s"
""
) ;_ if
" purged."
) ;_ strcat
) ;_ princ
)
) ;_ defun
;==========================================================
; SETV function saves setvar settings to be reset at end with RSETV
; (setv "cmdecho" 0) set cmdecho off
; (rsetv "cmdecho") resets cmdecho (see below)
; taken from Essential AutoLISP by Roy Harkow
;==========================================================
(defun SETV
(sysvar newval
/ cmdnam
) (set cmdnam
(getvar sysvar
)) ;Save [savevar]'s value (setvar sysvar newval
) ;Then set [savevar] to new value )
(setvar sysvar
(eval cmdnam
)) ;Restore [savevar]'s value ) ;end progn
) ;end if
)