Hi
Here is something from Peter Jamtgaard (an old LISP Guild post) that might prove an interesting starting point...
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