Author Topic: sv$, automatic saves, corrupted files  (Read 3029 times)

0 Members and 1 Guest are viewing this topic.

cparnell

  • Guest
sv$, automatic saves, corrupted files
« on: October 05, 2005, 06:37:05 PM »
I use A2K4.

With in the last year or 2, I had a fellow drafter loose two different large 3D files because they some how became corrupted. The first file I tried to retrieve the file by renaming the bak and sv$ file to dwg, but was unable to open the files, I guess they were corrupted as well. I tried to insert it as a block to no avail, however I was able to use, I believe it was the partialload command, and that did the trick. The second file, I tried every thing that I have read over the past 5 years or so but could not recover anything.

I read this article about 2 months ago concerning AutoCAD’s autosave feature.
http://rkmcswain.blogspot.com/2005/07/autosave-mystery.html
The article talks about creating an additional network drive that has write rights but not delete rights to direct the sv$ files to. So when one finds a corrupted file they should be able to go to this network drive and change the sv$ of that file to dwg and open it. I’m guessing that this would create a very large number of sv$ files for one dwg file since AutoCAD could not delete the previous sv$ file that it created.

I did not find very much in the Knowledge Base about sv$, at least to answer my questions about this matter. In the Options Dialog Box in A2K4, Open and Save tab, there is a section in that tab called File Save. Is Incremental Save Percentage related to AutoCAD’s automatic save feature? AutoCAD’s help file states:
Incremental Save Percentage
Sets the percentage of potentially wasted space in a drawing file. When the specified percentage is reached, AutoCAD performs a full save instead of an incremental save. Full saves eliminate wasted space. If you set Incremental Save Percentage to 0, every save is a full save.
Although incremental saves increase the size of your drawing, do not set a very low value. Low values degrade performance because AutoCAD performs time-consuming full saves more often. For optimum performance, set the value to 50. If hard disk space becomes an issue, set the value to 25. If you set the value to 20 or less, performance of the SAVE and SAVEAS commands slows significantly. ( ISAVEPERCENT system variable)
Why is it a bad idea to set a low value for the Incremental Save Percentage? Would this not allow one to recover a more complete file? We have nice work stations and I don’t notice much if any lag time during the save process.

By the way, I noticed that the Express Tools has a Movebak command that would allow me to change the default location of the BAK files. Would it work if I changed the BAK location to this new network drive that has write rights but not delete rights. In the Knowledge Base TS68939, it states:
Solution
Automatic save creates SV$ files. If a second automatic save is done on the same drawing, it renames the original SV$ file to a BAK file. So, after two automatic saves, you have a BAK file and a SV$ file. These are actually DWG files. If you want to have access to the drawing after something happens to the original, rename the file, changing the .sv$ or .bak file extension to .dwg.
Has anyone done any thing like this?
Any ideas, suggestions, comments?
Any help would be appreciated as I would like to try this for my self, if I can get my network administrator to help me out. He did suggest creating a folder on my C:\ drive to do this.

LE

  • Guest
Re: sv$, automatic saves, corrupted files
« Reply #1 on: October 05, 2005, 06:58:00 PM »
Here is something to digest...

http://discussion.autodesk.com/thread.jspa?messageID=4862411

And here is my contribution to that particular thread, that day.... hope it is somehow what you need.

Code: [Select]
Reply From: Luis Esquivel
Date: Jun/03/05 - 17:01 (GMT)
   
    Re: Delete Autosave
Okay,

Since I am not familiar on how the autosave naming is, I was assuming that the file is truncated, now for the drawings have open here, appears that the filename base is kept, please do your own corrections on this.

Here is the latest:

;; 10:07 AM 6/1/2005 LE
;; 12:45 AM 6/2/05 LE
;; 3:06 PM 6/2/05 LE
;; 9:55 AM 6/3/05 LE
 
(vl-load-com)
 
(if (not (vl-file-directory-p "C:\\AUTOSAVE\\"))
  (vl-mkdir "C:\\AUTOSAVE\\"))
 
;; this appears to work on an MDI system
;; open more than one drawing(s) and load the
;; reactor on each of them, to test this
(defun copy_sv$ (reactor params / files file)
  (if
    (and (setq files
(vl-directory-files (getvar "SAVEFILEPATH") "*.SV$"))
(setq file
(vl-some
  (function
    (lambda (dwg)
      (if
(wcmatch
  dwg
  (strcat "*"
  (vl-filename-base (getvar "DWGNAME"))
  "*"))
dwg)))
  files)))
     (progn
 
       ;; make a copy of SV$ file into the c:\\autosave folder
       ;; as a drawing extension with the OUT_ prefix
       (vl-file-copy
(strcat (getvar "SAVEFILEPATH") "\\" file)
(strcat "C:\\AUTOSAVE\\" "OUT_" (getvar "DWGNAME")))
 
       ;; delete previous BAK_ file
       (vl-file-delete
(strcat "C:\\AUTOSAVE\\" "BAK_" (getvar "DWGNAME")))
 
       ;; rename the new OUT_ file with the BAK_ prefix
       (vl-file-rename
(strcat "C:\\AUTOSAVE\\" "OUT_" (getvar "DWGNAME"))
(strcat "C:\\AUTOSAVE\\" "BAK_" (getvar "DWGNAME")))
 
       ;; delete OUT_ file
       (vl-file-delete
(strcat "C:\\AUTOSAVE\\" "OUT_" (getvar "DWGNAME"))))))
 
(if (not dwg_reactor)
  (setq dwg_reactor
(vlr-dwg-reactor nil '((:vlr-beginsave . copy_sv$)))))
 
(princ)

LE

  • Guest
Re: sv$, automatic saves, corrupted files
« Reply #2 on: October 05, 2005, 07:01:03 PM »
Also there must here some code made by Jeff Mishler in VBA, that might be helpful too.

Give a try to the search engine...

Good luck,
Luis

cparnell

  • Guest
Re: sv$, automatic saves, corrupted files
« Reply #3 on: October 06, 2005, 08:44:53 AM »
LE:

I thank you for your help. You have given me alot to read and think about.
Are there any other experiences that any one can tell be about, problems with what you have tired, etc?
Thanks in advance for any help.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: sv$, automatic saves, corrupted files
« Reply #4 on: October 06, 2005, 09:17:42 AM »
This is what i threw together for backups. It works well for me.


Code: [Select]
;;;;_____________________________________________________________________________
;;;;;MAKES COPY OF DRAWING IN C:\AutoCAD-BAK\%date%\%hour%\%dwgpath%
;;;;_____________________________________________________________________________

(defun copydwg (/ destdir dwgdir *date* hour dwgpath bkupdir)
  (if (= (getvar 'dwgtitled) 1)
    (progn
      (defun *date* (/ curdate curtime)
(setq curdate (rtos (fix (getvar 'cdate)) 2 0)
      curtime (strcat (substr curdate 5 2)
      "-"
      (substr curdate 7 2)
      "-"
      (substr curdate 1 4)
      "/"
      )
)
      )
      (defun hour (/ ctime stime)
(setq ctime (rtos (rem (getvar 'cdate) 1) 2 6)
      stime (strcat (substr ctime 3 2) "/")
)
      )
      (setq bkupdir "C:/AutoCAD-BAK/")
      (setq dwgpath (strcat (vl-string-right-trim
      "_"
      (substr (vl-string-translate
"\\\""
"_"
(getvar 'dwgprefix)
      )
      4
      )
    )
    "/"
    )
      )
      (if (not
    (vl-file-directory-p bkupdir)
  )
(vl-mkdir bkupdir)
      )
      (if (not
    (vl-file-directory-p (strcat bkupdir (*date*)))
  )
(vl-mkdir (strcat bkupdir (*date*)))
      )
      (if (not
    (vl-file-directory-p (strcat bkupdir (*date*) (hour)))
  )
(vl-mkdir (strcat bkupdir (*date*) (hour)))
      )
      (if (not
    (vl-file-directory-p
      (strcat bkupdir (*date*) (hour) dwgpath)
    )
  )
(vl-mkdir (strcat bkupdir (*date*) (hour) dwgpath))
      )
      (if (findfile
    (strcat bkupdir (*date*) (hour) dwgpath (getvar 'dwgname))
  )
(vl-file-delete
  (strcat bkupdir (*date*) (hour) dwgpath (getvar 'dwgname))
)
      )
      (setq destdir (strcat bkupdir
    (*date*)
    (hour)
    dwgpath
    (getvar 'dwgname)
    )
    dwgdir  (strcat (getvar 'dwgprefix) (getvar 'dwgname))
      )
      (vl-file-copy dwgdir destdir T)
    )
  )
)
(copydwg)


;_____________________________________________________________________________
;;COMMAND REACTORS
;_____________________________________________________________________________

(vlr-command-reactor nil '((:vlr-commandEnded . endCommand)))

(defun endCommand (calling-reactor endcommandInfo / thecommandend)
(setq thecommandend (nth 0 endcommandInfo))
(cond
  ((= thecommandend "QSAVE") (copydwg))
  ((= thecommandend "SAVE") (copydwg))
)
)
« Last Edit: October 05, 2006, 02:47:53 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC