PDA

View Full Version : AutoSave multiple dwg's


fletch97
2008-02-07, 12:11 AM
Does anyone have or know of a lisp routine that will force CAD to autosave all drawings open on the workstation regardless of whether they are being worked on at the moment?

For those of you unaware of this problem, CAD will only create a sv$ file for the dwg currently on your screen regardless of how many dwg's you have open at the time. I have a lot of users who open 5 to 8 dwg's at a time and don't save often. When they crash, they lose all work except the one dwg that was being worked on because it had an autosave file. Even know they SHOULD be saving, I'd like to see if I can help from a programming side.

Any help will greatly be appreciated!

Richard.Kent
2008-02-07, 12:58 AM
Perhaps you could use the Express Tools saveall command?

T.Willey
2008-02-07, 01:19 AM
You might be able to setup a reactor that would fire when the autosave fires to save all open drawings to the same location and extension set by the autosave.

rkmcswain
2008-02-07, 02:54 PM
Does anyone have or know of a lisp routine that will force CAD to autosave all drawings open on the workstation regardless of whether they are being worked on at the moment?

It already does this.

I just tested it to confirm. Here are the steps.

1. Open AutoCAD, set SAVETIME to 1, and set SAVEFILEPATH to an empty directory.
2. Close all drawings.
3. Open Windows Explorer to the directory set in step 1.
4. Open and save 3 separate drawings.
5. Draw something in all three drawings, then switch back to drawing "1" and start working.
6. After a minute of so, watch the Explorer window - autosave files are generated for the drawing you are in and the other two drawings that are "not being worked on"

BrenBren
2008-02-07, 03:26 PM
It already does this.

I just tested it to confirm. Here are the steps.

1. Open AutoCAD, set SAVETIME to 1, and set SAVEFILEPATH to an empty directory.
2. Close all drawings.
3. Open Windows Explorer to the directory set in step 1.
4. Open and save 3 separate drawings.
5. Draw something in all three drawings, then switch back to drawing "1" and start working.
6. After a minute of so, watch the Explorer window - autosave files are generated for the drawing you are in and the other two drawings that are "not being worked on"

I thought that to be true as well. You need to make changes, but whenever I've had a crash with multiple drawings open, the ones that I weren't working on had Autosave files created - they were all stamped the same time.

fletch97
2008-02-07, 05:06 PM
I have tested this several times and it does not autosave the other files that are open.

I watched it with my own eyes in ACA 2008.

Several articles have also been published stating that it doesn't do it.

T.Willey - That sounds like an idea but I wouldn't know where to begin a program like that? Any ideas?

BrenBren
2008-02-07, 05:11 PM
I have tested this several times and it does not autosave the other files that are open.

I watched it with my own eyes in ACA 2008.

Several articles have also been published stating that it doesn't do it.

T.Willey - That sounds like an idea but I wouldn't know where to begin a program like that? Any ideas?

Can you link to some of those articles. I'm very interested in reading about this.

Note, it will only Autosave if a change has been made to those drawings, and once it autosaves once, it will not autosave again until another change has been made to that drawing.

T.Willey
2008-02-07, 06:14 PM
T.Willey - That sounds like an idea but I wouldn't know where to begin a program like that? Any ideas?

You can use this as a start point. I haven't looked at it since I did it, but it should show you enough to build your own from.

fletch97
2008-02-07, 06:29 PM
Thanks T.Willey!......it's a good start.


BrenBren....here is one link...

http://hyperpics.blogs.com/beyond_the_ui/2004/08/confused_by_aut.html

I came across others but will need to search for them again.

rkmcswain
2008-02-07, 07:18 PM
Note, it will only Autosave if a change has been made to those drawings, and once it autosaves once, it will not autosave again until another change has been made to that drawing.

That is exactly right. This is no different that if you have a single drawing open or if you are working where SDI=1.

rkmcswain
2008-02-07, 07:22 PM
http://hyperpics.blogs.com/beyond_the_ui/2004/08/confused_by_aut.html



That is just incorrect information, unless it used to do that in a previous version -or- it behaves differently in vanilla AutoCAD compared to various verticals.

I will try and test in vanilla AutoCAD and in a few versions of some verticals later as time permits.

Trust me, I watched the .sv$ file being created without the drawing having focus.

CadDog
2008-02-07, 09:58 PM
Here is what we have done for years because of that same problem...

We add to our AcadDoc.lsp these lines:

(if (= (getvar "dwgtitled") 1)
(progn
(Setvar "cmdecho" 0)
(setvar "coords" 2)
(command "dctmain" "enu")
(command "UCSICON" "N")
(command "xloadctl" "2")
(command "WIPEOUT" "F" "OFF") ;Added on 12/07
(command "indexctl" "3")
(command "osnapcoord" "1")
(command "regenauto" "on")
(command "xrefctl" "0") ;xref log files off
(command "qtext" "off")
(command "dimassoc" "1"); set dimassoc off to keep 14 dims intact - mwk

(if (> (getvar "savetime") 1) (vl-cmdf "savetime" "1"))

(Setvar "cmdecho" 1)
(command)
)
)

Note: (vl-cmdf "savetime" "1")

We found this to do the tick...
Along with the use of TABS and Auto Save every minute...
We also create a directory on their loca drive...
C:/Temp/SaveDwg/2006

Where these file can be retrieve as needed...

(Sylvie ask me to answer this question for you)

rkmcswain
2008-02-08, 01:03 AM
Here is what we have done for years because of that same problem...

Note: (vl-cmdf "savetime" "1")

We found this to do the tick...


That has nothing to do with the problem that fletch97 says is happening.

All that (vl-cmdf "savetime" "1") does is set SAVETIME to 1 minute.

rkmcswain
2008-02-08, 07:36 PM
I have verified that AutoCAD autosaves multiple unsaved drawings, regardless if they have focus or not..

Tested on:
R2000i (vanilla AutoCAD)
R2005 (vanilla AutoCAD)
R2006 (Land Enabled Map)
R2008 (Land Enabled Map)
R2008 (vanilla AutoCAD)

Note:

Each time Autosave fires, it seems to only catch one drawing at a time.
For example, I created the three drawings and changed them, all within a few seconds of each other.
Say the time was 11:00AM

At ±11:01, autosave fires and only the current drawing with focus is written to disk.
At ±11:02, the second drawing gets "autosaved"
At ±11:03, the third drawing gets "autosaved"

This applies no matter what the setting of SAVETIME. Each "background" drawing is autosaved one minute later than the one in front of it. So it looks like there could be a problem if you have a lot of background drawings open. The number of minutes until the last one is "autosaved" is determined by the current value of SAVETIME + the number of background drawings open.


IOW - if you have 10 drawings open and SAVETIME = 10 and all drawings are modified at 11:00AM, and drawing 1 is the only drawing with focus the entire time.

Drawing 1 gets autosaved at 11:10AM
Drawing 2 gets autosaved at 11:11AM
Drawing 3 gets autosaved at 11:12AM
Drawing 4 gets autosaved at 11:13AM
Drawing 5 gets autosaved at 11:14AM
Drawing 6 gets autosaved at 11:15AM
Drawing 7 gets autosaved at 11:16AM
Drawing 8 gets autosaved at 11:17AM
Drawing 9 gets autosaved at 11:18AM
Drawing 10 gets autosaved at 11:19AM

This seems like a bug to me. I would expect them all to be autosaved at exactly the same time....