Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: LISP - Automatic Save that runs at set intervals

  1. #1
    100 Club
    Join Date
    2004-12
    Posts
    153
    Login to Give a bone
    0

    Default LISP - Automatic Save that runs at set intervals

    Is there any way to have a lisp routine run at a set interval? I am looking to see if i can do a save every 10 minutes with a different name each time. Since AutoCAD doesn't save the backup saves when it closes, several people in my workplace are looking for a way to save a drawing that is in a design phase so they might be able to revert back to undo changes that were made.

    Thank you in advance.

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

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

    I would think you would need to look into reactors.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

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

    Hi

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

    Quote Originally Posted by Peter Jamtgaard

    VLR_AUTO_SAVE.LSP is a program that will save after every 10 commands. It will not save while a lisp program is being executed.

    Try it out and let me know if you like it or not, bugs, you know.
    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

  4. #4
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,109
    Login to Give a bone
    0

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

    try this version
    Attached Files Attached Files

  5. #5
    I could stop if I wanted to
    Join Date
    2002-02
    Location
    Kansas
    Posts
    487
    Login to Give a bone
    0

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

    If you are use AutoCAD 2000 and up all you need to do is open options and on open and save tab set automatic save to 10 minutes and select the check box for automatic save and create backup copy with each save. on the files tab set the Automatic Save File Location to the path where to save the files. AutoCAD will do the job for you. The files will be save with a name like filename_1_1_1427.sv$ or filename_1_1_2427.Bak use the date modified is the time the file was saved. To to revert back change the sv$ or bak to dwg and open the file.

    Note: if thefile is not open for 10 min the autosave will not take place
    Last edited by jwanstaett; 2005-10-20 at 02:41 PM.

  6. #6
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

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

    Quote Originally Posted by jwanstaett
    If you are use AutoCAD 2000 and up all you need to do is open options and on open and save tab set automatic save to 10 minutes and select the check box for automatic save and create backup copy with each save. on the files tab set the Automatic Save File Location to the path where to save the files. AutoCAD will do the job for you. The files will be save with a name like filename_1_1_1427.sv$ or filename_1_1_2427.Bak use the date modified is the time the file was saved. To to revert back change the sv$ or bak to dwg and open the file.

    Note: if thefile is not open for 10 min the autosave will not take place
    Hi

    Under most normal conditions the SV$ and BAK files will automatically be deleted once a clean exit from the drawing file(s) occurs.

    ID: TS68939 - BAK files created as backups of SV$ automatic save files are not deleted after exit

    ID: TS73581 - Automatic save files (SV$ files) no longer kept after normal exit

    ID: TS20536 - Automatic save (SV$) files

    Have a good one, Mike

  7. #7
    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 Mike.Perry
    Hi

    Under most normal conditions the SV$ and BAK files will automatically be deleted ...
    mnnnnot really.. the bak file in not deleted after a normal exit, but you can tell the system to not create it.

    : ) Happy Computing !

    kennet

  8. #8
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

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

    Quote Originally Posted by kennet.sjoberg
    mnnnnot really.. the bak file in not deleted after a normal exit, but you can tell the system to not create it.
    Hi

    The BAK file will be a copy of the drawing file from the Save before Closing, therefore only one BAK will exist... totally pointless in the context of this thread...

    Have a good one, Mike

  9. #9
    All AUGI, all the time
    Join Date
    2015-12
    Location
    Central Oregon
    Posts
    591
    Login to Give a bone
    0

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

    I think that THIS thread over at theSwamp.org has exactly what you are looking for. The post by Kerry, specifically.

    Jeff

  10. #10
    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 Mike.Perry
    Hi
    The BAK file will be a copy of the drawing file from the Save before Closing, therefore only one BAK will exist... totally pointless in the context of this thread...

    Have a good one, Mike
    Absolutely correct, I was just correcting your statement, about automatically deleting *.BAK files.

    : ) Happy Computing !

    kennet
    Last edited by kennet.sjoberg; 2005-10-20 at 08:12 PM.

Page 1 of 3 123 LastLast

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
  •