[A]
When working on a sheet, when done with it, I use this function to close it. It works so well with the button I have on my toolbar.
^C^C_purge;all;*;n;zoom;e;qsave;CLOSE;
----------------------------------------------------------------------------------
[B]
I had opened 42 sheets from the Sheet Set Manager. I needed to quickly preview the sheets for final printing, and did not need to save them again, since I had to zoom to different areas of the sheets, which were originally saved Extents zoom. In this case, this command works perfectly well. I also have it as a button on my toolbar.
(defun doc:CloseAllButActive (TrueOrFalse / cnt)
(setq cnt 0)
(vlax-for Item (vla-get-Documents (vlax-get-acad-object))
(if (= (vla-get-Active Item) :vlax-False)
(progn
(vla-close Item TrueOrFalse)
(setq cnt (1+ cnt))
)
)
)
cnt
)
(defun c:cns ( / cnt) ;CLOSES ALL NO SAVE BUT CURRENT ACTIVE
(setq cnt (doc:CloseAllButActive :vlax-False))
(if (> cnt 0)
(princ (strcat "\n(" (itoa cnt) ") document" (if (> cnt 1) "s" "") "
closed without saving."))
(princ "\nNo documents to close.")
)
(princ)
)
----------------------------------------------------------------------------------
Would it be possible to combine [A] & [B]?
That is, have multiple sheets opened to do some changes by cross-referencing them. When done, I would like to just click a button to do both of the above commands, which is, "purge;all;*;n;zoom;e;qsave" and close all without asking on every file to close it? Hope my English expression is clear enough here?
Cheers