Page 3 of 3 FirstFirst 123
Results 21 to 29 of 29

Thread: LISP - Automatic Save that runs at set intervals

  1. #21
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: LISP - Automatic Save that runs at set intervals

    The auto save.lsp works fine, I figured out the save location. How would I modify the reactor so it doesn't run the auto save when the command that was issued was open, or quit. I notice that sometimes I have to wait for an auto save to complete before a drawing will close, or even when I am opening a new drawing, sometimes the command hangs because it is waiting for the auto save to complete.

  2. #22
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: LISP - Automatic Save that runs at set intervals

    Quote Originally Posted by ccowgill
    . . .How would I modify the reactor so it doesn't run the auto save when the . ..
    The reactor do only control when to trigger and run a function/lisp-program.

    The function/lisp-program do the control

    : ) Happy Computing !

    kennet

    BTW if you set the autosave time to 20 minutes, switch to an other task in 30 minutes
    and then return to the first task...the autosave will run...if it is not set to OFF.

  3. #23
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: LISP - Automatic Save that runs at set intervals

    Isn't the reactor what causes the program to initiate the auto save, it doesn't automatically save every 10 minutes, it saves after the next command that is initiated after 10 minutes, so if you have your drawing open and leave for 1/2 hour, when you come back, it hasn't auto saved, but if you do anything, it will proceed to auto save following the command.

  4. #24
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: LISP - Automatic Save that runs at set intervals

    Quote Originally Posted by ccowgill
    Isn't the reactor what causes the program to initiate the auto save, it doesn't automatically save every 10 minutes, it saves after the next command that is initiated after 10 minutes, so if you have your drawing open and leave for 1/2 hour, when you come back, it hasn't auto saved, but if you do anything, it will proceed to auto save following the command.
    BTW if you set the autosave time to 20 minutes, switch to an other task in 30 minutes
    and then return to the first task...the autosave will run...if it is not set to OFF.


    : ) Happy Computing !

    kennet

  5. #25
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: LISP - Automatic Save that runs at set intervals


    Command: N
    QSAVE
    Command: *Cancel*
    Command: *Cancel*
    Command: _quit
    Initiating AutoSave Function on File <c:\autocad auto save\BAKUP DWG\X5227.DWG_20061026.1735.dwg>:
    Command:
    This is what I wish to prevent, I save, then I exit the drawing and have to wait for the autosave produced by autosave.lsp to complete.

  6. #26
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: LISP - Automatic Save that runs at set intervals

    Quote Originally Posted by ccowgill
    This is what I wish to prevent, I save, then I exit the drawing and have to wait for the autosave produced by autosave.lsp to complete.
    Turn Autosave OFF

    : ) Happy Computing !

    kennet

  7. #27
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: LISP - Automatic Save that runs at set intervals

    More info. . .

    SAVETIME System Variable

    Type: Integer
    Saved in: Registry
    Initial value: 10

    Sets the automatic save interval, in minutes.

    0 Turns off automatic saving.
    >0 Saves the drawing at intervals specified by the nonzero integer automatically

    The SAVETIME timer starts as soon as you make a change to a drawing.
    It is reset and restarted by a manual QSAVE, SAVE, or SAVEAS.
    The current drawing is saved to the path specified by the SAVEFILEPATH system variable.
    The file name is stored in the SAVEFILE system variable.

    (setvar "SAVETIME" 0 ) ; = System Autosave OFF


    : ) Happy Computing !

    kennet

  8. #28
    Member
    Join Date
    2006-10
    Posts
    2
    Login to Give a bone
    0

    Default Re: LISP - Automatic Save that runs at set intervals

    Quote Originally Posted by Mike.Perry View Post
    Hi

    Here is something from Peter Jamtgaard (an old LISP Guild post) that might prove an interesting starting point...


    Code:
    (defun C:VLR_AUTO_SAVE ()
      (vl-load-com)
      (setq ASRXN1 (vlr-editor-reactor nil '((:vlr-commandended	 . ASCOM1)))
     	   ASRXN2 (vlr-lisp-reactor nil   '((:vlr-lispWillStart	. ASCOM2)))
     	   ASRXN3 (vlr-lisp-reactor nil   '((:vlr-lispended		. ASCOM3)))
      )
     )
     (defun ASCOM1 (CALL CALLBACK)
      (if (not LISPRUN)
       (progn
        (cond
     	((= (car CALLBACK) "SAVE")
     	 (setq ASCOUNT 0)
     	)
     	((= (car CALLBACK) "QSAVE")
     	 (setq ASCOUNT 0)
     	)
        )
        (if (not ASCOUNT)
     	(setq ASCOUNT 0)
     	(if (> ASCOUNT 9)
     	 (progn
     	  (setq ASCOUNT 0)
     	  (vla-save (vla-get-activedocument (vlax-get-acad-object)))
     	  (print "AutoSave")
     	 )
     	 (progn
     	  (setq ASCOUNT (1+ ASCOUNT))
     	  (print ASCOUNT)
     	 )
     	)
        )
       )
      )
     )
     (defun ASCOM2 (CALL CALLBACK)
      (setq LISPRUN 'T)
     )
     (defun ASCOM3 (CALL CALLBACK)
      (setq LISPRUN nil)
     )
    Have a good one, Mike
    i know this is an old thread but,
    anyone know how I can get this to work with lisp and button macros?
    i really like how this works

  9. #29
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: LISP - Automatic Save that runs at set intervals

    Quote Originally Posted by Mike.Perry View Post

    Under most normal conditions the SV$ and BAK files will automatically be deleted once a clean exit from the drawing file(s) occurs.
    True for .sv$ files, but not for .bak files that are backups of the .sv$ files, IOW, the ones in the %temp% location. (not the .bak files that are backups of the .DWG file).

    .sv$ backup files are retained in the %temp% folder until manually removed.

    R.K. McSwain | CAD Panacea |

Page 3 of 3 FirstFirst 123

Similar Threads

  1. Automatic save turns itself off
    By litchfieldl in forum AutoCAD General
    Replies: 27
    Last Post: 2014-05-09, 05:20 AM
  2. AutoLISP Routine for automatic save locations
    By VANSKIPPER in forum AutoLISP
    Replies: 5
    Last Post: 2008-04-08, 02:46 AM
  3. LISP routine runs twice
    By chrisw.94380 in forum AutoLISP
    Replies: 1
    Last Post: 2005-10-11, 09:25 PM
  4. Automatic Save
    By rchampaia in forum AutoCAD General
    Replies: 7
    Last Post: 2004-09-15, 04:50 PM

Posting Permissions

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