Results 1 to 3 of 3

Thread: LISP To Save All Without Asking On Each Sheet

  1. #1
    I could stop if I wanted to
    Join Date
    2001-11
    Posts
    236
    Login to Give a bone
    0

    Default LISP To Save All Without Asking On Each Sheet

    [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

  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: LISP To Save All Without Asking On Each Sheet


  3. #3
    I could stop if I wanted to
    Join Date
    2001-11
    Posts
    236
    Login to Give a bone
    0

    Default Re: LISP To Save All Without Asking On Each Sheet

    Quote Originally Posted by Tom Beauford View Post
    Thanks . . . that's my post at the Autodesk Forum, on the same topic.

Similar Threads

  1. Lisp to fill in title block of each sheet
    By lynx_20 in forum AutoLISP
    Replies: 9
    Last Post: 2016-03-08, 12:40 AM
  2. Allow for a �Sheet Scale� to be applied to each sheet
    By inventor.wishlist1738 in forum Inventor Wish List
    Replies: 0
    Last Post: 2010-09-27, 07:51 PM
  3. For each...next within for each...next
    By CADfunk MC in forum VBA/COM Interop
    Replies: 2
    Last Post: 2009-05-15, 05:01 PM
  4. Replies: 4
    Last Post: 2008-05-07, 02:10 PM
  5. Undo does it all without asking
    By sandy.sebastian in forum AutoCAD General
    Replies: 10
    Last Post: 2005-09-27, 05:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •