(defun c:purgesave (/ $acad $doc i LayoutsLst nLayoutsLst) (vl-load-com) (setq $doc (vla-get-activedocument (vlax-get-acad-object))) (repeat 4 (vla-purgeall $doc) ) (setq i 0LayoutsLst (layoutlist)nLayoutsLst (length LayoutsLst) ) (repeat (- nLayoutsLst 1) (command "_.LAYOUT" "_D" (nth i LayoutsLst)) (setq i (1+ i)) ) (vla-save $doc) (vlax-release-object $doc) (princ "\nDrawing has been completely purged and successfully saved." ) (princ))
Why you get after using the program PURGESAVE
at the CLOSE command a dialog box for saving in
some drawings.(See TestDwg
Is (vla-save $doc) something else than (Command "_.SAVE" "").