Lee Mac Posted April 2, 2009 Share Posted April 2, 2009 when i saved your code, do i need save it as a .lsp or a .txt then load it in the appload? A Reactor is still a LISP file, just a different type of function - should be saved as a .lsp as normal. Quote Link to comment Share on other sites More sharing options...
andre81 Posted December 22, 2011 Share Posted December 22, 2011 I've got a question for LEE MAC's routine. I've start to use it - it works well - but sometimes I have to use 'undo' command. When I use it then counter for 'save' command rise fast and do saving during I'm still pressing 'Ctrl+Z'. How to exclude counting 'i' when I use 'undo' command? The reason I'm using this routine is that I have open about 10 drawings in the same time but need to save just few - the other are for read only. So when I have turn on "auto-save" in Autocad it need time to save all drawings. By the way - maybe someone use SSD drives - how it works during autosave and working with Autocad - especially xrefs? Quote Link to comment Share on other sites More sharing options...
ReMark Posted December 22, 2011 Share Posted December 22, 2011 Why would having a SSD drive work any differently than a normal (platter style) drive doing an autosave? Quote Link to comment Share on other sites More sharing options...
andre81 Posted December 22, 2011 Share Posted December 22, 2011 Cause it's much faster and has shorter access time so: - soft installed on it should work faster, - TEMP directory located on SSD should make autosave much faster, - drawings located on SSD drive should open and save faster, For example now I have drawing with attached 9 xrefs and during autosave runnig I have to wait about 25 seconds and I'm lose my attention. Quote Link to comment Share on other sites More sharing options...
ReMark Posted December 22, 2011 Share Posted December 22, 2011 The fact that the drive is faster should have no bearing what-so-ever on the functionality of autosave. It will work. Period. Quote Link to comment Share on other sites More sharing options...
andre81 Posted December 22, 2011 Share Posted December 22, 2011 That's no doubt. I thought about time - how long it takes. As I said - depend of drawing - now I takes for me about half minute - with standard drive. I have set time period for 15 minutes so every 15 minutes I have to wait at least half minute - depending also how many other drawings I heave open. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 22, 2011 Share Posted December 22, 2011 I've got a question for LEE MAC's routine. I've start to use it - it works well - but sometimes I have to use 'undo' command. When I use it then counter for 'save' command rise fast and do saving during I'm still pressing 'Ctrl+Z'. How to exclude counting 'i' when I use 'undo' command? Try this updated version: (vl-load-com) (if (null *save:react*) (setq *save:react* (vlr-command-reactor nil '((:vlr-commandwillstart . savedwg))) *save:acdoc* (vla-get-activedocument (vlax-get-acad-object)) *save:count* 0 ) ) (defun savedwg ( reactor params ) (if (and (not (wcmatch (strcase (car params)) "*UNDO")) (zerop (rem (setq *save:count* (1+ *save:count*)) 10)) ) (if (zerop (getvar 'DWGTITLED)) (vla-saveas *save:acdoc* (strcat (getvar 'DWGPREFIX) (getvar 'DWGNAME))) (vla-save *save:acdoc*) ) ) (princ) ) (princ) Quote Link to comment Share on other sites More sharing options...
ReMark Posted December 22, 2011 Share Posted December 22, 2011 Yes, I agree. The read/write times of the SSD should make the saving process go a bit faster. There should be no downside to using a SSD. However, given the cost of an SSD versus a regular hard drive wouldn't it be better to save your drawing files to the regular hard drive? I know that having the program itself loaded on the SSD is definitely the way to go. Quote Link to comment Share on other sites More sharing options...
Jack_O'neill Posted December 22, 2011 Share Posted December 22, 2011 Guys...I don't know what you all have for computers...but saving every 10th command or once a minute would drive me insane. Maybe you're just super fast but come on... If you are losing that much work, buy a UPS so your computer stays on. Don't get me wrong, I'm a great believer in autosave, but I have mine set at 15 minute intervals. Every minute? Ain't no way you can lose that much in a minute. Quote Link to comment Share on other sites More sharing options...
andre81 Posted December 23, 2011 Share Posted December 23, 2011 hm. I thought the drawing is big and cause it has many xrefs sav and autosave takes many time but.... after "autocad fatal error: cannot write to undo file (probably disk full)" I found indirect reason. When I set variable SAVEFIDELITY to 0 (same unchecked options -> Open and Save -> Maintain visual fidelity for annotative objects) save or autosave takes 1 second so it's solve my problem. Quote Link to comment Share on other sites More sharing options...
andre81 Posted December 23, 2011 Share Posted December 23, 2011 Thanks Lee Mac for routine. I will check it. Maybe my English isn't good enough so I didn't explain it well. My idea was - use save/autosave only for drawings which I change: - turn off autosave - load Lee Mac's routine for constuction drawing which I'm working on - don't use save for architecture drawings which I'm don't change - just compere with my constructions drawings - so i don't waste time for autosave these drawings Now after setting SAVEFIDELITY to 0 it works well also with autosave. @ReMark - I agree that SSD is now too expensive especially for my but not for my company. @Jack_O'neill - You've got right - autosave every 10 commands is too often. I've just change Lee Mac's counter - routine is usefull. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 23, 2011 Share Posted December 23, 2011 You're welcome The program is only a basic example, you can refine and modify it to suit your needs. Quote Link to comment Share on other sites More sharing options...
Dj_T_Rex2002 Posted January 12, 2012 Share Posted January 12, 2012 A much simpler command to set list is as follows: start of AutoSave.lsp (if ( ) the "5" is for 5 minutes so if you want to set it for 30 minutes, yes you guessed it ... type 30 Quote Link to comment Share on other sites More sharing options...
Faouweb Posted May 28, 2015 Share Posted May 28, 2015 Will save after 10 commands ~ just load it. (defun Make_Reactor () (vl-load-com) (if (not save:reactor) (setq save:reactor (vlr-command-reactor nil '((:vlr-commandWillStart . SvPrompt))))) (princ)) (Make_Reactor) (defun SvPrompt (Reac Args / doc) (or i (setq i 0)) (if (= i 10) (progn (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) (vla-save doc) (vla-saveas doc (strcat (getvar "dwgprefix") (vla-get-name doc))) (setq i 0)) (setq i (1+ i))) (princ)) Thank you Lee very helpful Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 28, 2015 Share Posted May 28, 2015 Thank you Lee very helpful You're welcome! - More recent code pertaining to this topic may be found here. Quote Link to comment Share on other sites More sharing options...
PBxpto Posted August 12, 2020 Share Posted August 12, 2020 (edited) I use Lee Mac solution, (I'm an old Lisp programmer), I added a small change to check if any entity is created. also changed the names of variables, just to avoid any problems with undeclared variables. I don´t want to save unchanged files, although I may loose some changes to entities, if I have changed but not created anything new. (defun Make_Reactor () (vl-load-com) (if (not save:reactor) (setq save:reactor (vlr-command-reactor nil '((:vlr-commandWillStart . SvPrompt))))) (princ)) (Make_Reactor) (setq #ncommandsave 20) (setq #entlastautosave (entlast)) (defun SvPrompt (Reac Args / doc) (or #autosave (setq #autosave 0)) (if (> #autosave #ncommandsave) (progn (if (not (equal #entlastautosave (entlast))) (progn (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) (vla-save doc) (vla-saveas doc (strcat (getvar "dwgprefix") (vla-get-name doc))) (setq #autosave 0) (setq #entlastautosave (entlast)) ) ) ) (setq #autosave (1+ #autosave)) ) ;(princ #autosave) (princ) ) Edited August 12, 2020 by PBxpto Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.