;;-------------------------------------------------------------------- ;; Clear-Atoms.LSP (c) 2001, John F. Uhden, Cadlantic ;; Function to remove from memory any AutoLisp symbols and VLA-OBJECTS ;; matching the given input string (not case-sensitive) ;; (defun clear-atoms (match / i j sym val) (setq i 0 j 0) (if (and (= (type match) 'STR)(/= match "*")) (foreach item (atoms-family 1) (if (wcmatch (strcase item)(strcase match)) (progn (setq sym (read item) val (eval sym) i (1+ i) ) (if (and (= (type val) 'VLA-OBJECT) (not (vlax-object-released-p val)) (setq j (1+ j))) (vlax-release-object val) ) (set sym nil) ) ) ) ) (if (> i 0)(princ (strcat "\nCleared " (itoa i) " atom(s)."))) (if (> j 0)(princ (strcat "\nReleased " (itoa j) " object(s)."))) (gc) (princ) )