Guest Posted December 2, 2014 Posted December 2, 2014 Hi i have a problem and i need some help Same times when i do right click in mtext editor autocad gives me a FATAL ERROR and then i lose my drawing. The name usually looks something like- my_drawing_1234567_08_04_29.sv$ and my_drawing_1234567_08_04_29.bak and some times to - my_drawing_1234567_08_04_29.dwg All this files are in a hiden file in C:\\Users\\Administrator\\AppData\\Local\\Temp I am searching for a lisp that finds the hiden file and show me only the *.sv$,*.bak,*.dwg files Then to give the option to open *.sv$,*.bak,*.dwg without rename *.sv$,*.bak to *.dwg 1) Give User name (and use as defoult Administrator) I don't know if it is possible to understand the user name automaticaly 2) open *.sv$,*.bak,*.dwg Thanks Quote
Hippe013 Posted December 2, 2014 Posted December 2, 2014 Here is a snippet of code to get you started. (setq *acad* (vlax-get-acad-object)) ;Get the acad object (setq pref (vlax-get-property *acad* 'Preferences)) ;Get the preferences property from the acad object (setq files (vlax-get-property pref 'Files)) ;Get the files property from the preferences property (setq tmpfilepath (vlax-get-property files 'TempFilePath)) ;Get the temp file path from the files property Hope that this helps! regards, Hippe013 Quote
Dana W Posted December 2, 2014 Posted December 2, 2014 None of those files will open in AutoCad, except the *.dwg file. The only one that will open even by renaming is the *.bak file, and it has to be renamed to *.dwg first. The other one, *.sv$ is a temporary automatic save file, and it can only be used through the drawing recover utility. As a matter of fact, the drawing recover utility will find all these files for you and give you a choice as to which one to open. Usually the one with the latest date and time, is the best choice. Quote
SLW210 Posted December 2, 2014 Posted December 2, 2014 I would also try to find out why AutoCAD crashes when you right-click in the MText Editor. Quote
Hippe013 Posted December 2, 2014 Posted December 2, 2014 The only one that will open even by renaming is the *.bak file, and it has to be renamed to *.dwg first. The other one, *.sv$ is a temporary automatic save file, and it can only be used through the drawing recover utility. A file with the SV$ extension can be renamed to DWG and be opened in AutoCAD. Sorry Dana, I don't mean to disagree, just wanted to point it out that a SV$ file can also be renamed to DWG. Quote
ReMark Posted December 2, 2014 Posted December 2, 2014 Just remember that when AutoCAD does close normally the .sv$ files are deleted. Does this mean we want AutoCAD to crash? Hmmmmmmmmm? Quote
Dana W Posted December 3, 2014 Posted December 3, 2014 A file with the SV$ extension can be renamed to DWG and be opened in AutoCAD. Sorry Dana, I don't mean to disagree, just wanted to point it out that a SV$ file can also be renamed to DWG. You're probably correct. I am glad someone is. I think there is another file created for recovery that can't be renamed because it is a totally different format, and I haven't looked it up, so I don't know what it is right now. I probably have the sv$ file confused with it. For some reason I just don't get a lot pf crashes, so I don't remember if there even is another file. Quote
ReMark Posted December 3, 2014 Posted December 3, 2014 There is another file created with the extension .ac$ and it is a temporary file. These types of files will normally be deleted when AutoCAD is closed correctly but may be left behind if AutoCAD crashes or terminates abnormally. Files of this type do not contain any drawing data that can be recovered so consider them useless if discovered and delete them. Quote
hanhphuc Posted December 3, 2014 Posted December 3, 2014 All this files are in a hiden file in C:\\Users\\Administrator\\AppData\\Local\\Temp I am searching for a lisp that finds the hiden file and show me only the *.sv$,*.bak,*.dwg files Then to give the option to open *.sv$,*.bak,*.dwg without rename *.sv$,*.bak to *.dwg 1) Give User name (and use as defoult Administrator) I don't know if it is possible to understand the user name automaticaly 2) open *.sv$,*.bak,*.dwg Thanks try this old thread ? HTH Quote
Guest Posted December 4, 2014 Posted December 4, 2014 Hi I try this but i think i have a problem with the user name . I want to have the option to change it (defun c:fetemp (/ admin) (setq [color="red"]admin [/color](cond ((getreal "\n Give user name (example George) : "))(George))) getfiled "Select a file" "C:\\Users\\[color="red"]admin[/color]\\AppData\\Local\\Temp" "*.sv$,*.bak,*.dwg" (princ) Thanks Quote
Guest Posted December 4, 2014 Posted December 4, 2014 I update the code to (defun c:fetemp (/ admin f) (setq admin (cond ((getreal "\n Give user name (example George) : "))(George))) (if (setq f (getfiled "" "C:/Users/admin/AppData/Local/Temp" "sv$ bak dwg" 16)) (startapp "explorer" f) ) (princ) ) But i have this problems 1) I canot change the user name in the path 2)How to write this "sv$ bak dwg" Thanks Quote
hanhphuc Posted December 4, 2014 Posted December 4, 2014 1) I canot change the user name in the path 2)How to write this "sv$ bak dwg" Thanks 1.getstring & strcat 2.sami colon (defun c:fetemp (/ admin f) (if (eq (setq admin ([color="red"]getstring[/color] t "\n Give user name (example George) : ")) "") "George" ) ;_ end of if (if (setq f (getfiled "" ([color="red"]strcat [/color]"C:\\Users\\" admin "\\AppData\\Local\\Temp") [color="red"]"sv$;bak;dwg"[/color] 16)) (startapp "explorer" f) ) ;_ end of if (princ) ) ;_ end of defun ;what to do next? [color="red"][EDIT]: you can't directly open sv$ & .bak ![/color] i prefer this as default temp (getfiled "" (getvar "tempprefix") "sv$;bak;dwg" 16) Quote
Guest Posted December 4, 2014 Posted December 4, 2014 [EDIT]: you can't directly open sv$ & .bak ! I know ,the only think i whant is to open me the folder and then i will rename the files to dwg to open Thanks Quote
hanhphuc Posted December 4, 2014 Posted December 4, 2014 I know ,the only think i whant is to open me the folder and the i will rename the files to dwg to plen the you can try vl-file-rename (example in post#6) or vl-filename-mktemp to avoid conflict name good luck:) Quote
Guest Posted December 4, 2014 Posted December 4, 2014 I thy to use (getfiled "" (getvar "tempprefix") "sv$;bak;dwg" 16) but i dont know how !! (defun c:fetemp ((getvar "tempprefix") "sv$;bak;dwg" 16) (startapp "explorer" f) ) (princ) Quote
hanhphuc Posted December 4, 2014 Posted December 4, 2014 Can you show me how? Thanks http://www.cadtutor.net/forum/showthread.php?89186-Movebak&p=610918&viewfull=1#post610918 (defun C:bak (/ fn path dwg) ;v1.1 (if (setq fn (getfiled "Select file" (getvar "tempprefix") "sv$;bak;dwg" 2)) (setq path (strcat (vl-filename-directory fn) "\\") dwg ([color="blue"]vl-filename-mktemp[/color] [color="red"]"george_"[/color] path ".dwg") ; <--- example george fn (if (/= (strcase (vl-filename-extension fn)) ".DWG") ([color="blue"]vl-file-copy[/color] fn dwg t) dwg ) ;_ end of if ) ;_ end of setq (princ "Failed! *cancel*") ) ;if (terpri) (if path (command "shell" (strcat "explorer \"" path)) ) ; optional: open the destination folder (princ) ) ;bak my apology vl-file-copy to avoid conflict. Quote
Guest Posted December 4, 2014 Posted December 4, 2014 dwg (vl-filename-mktemp "george_" path ".dwg") ; <--- example george 1) Is it posiible to keep (the original name of the file _backup.dwg) and nor george001.dwg 2) if the file needs recover can we add a command to do it ? Thanks Quote
AIberto Posted December 4, 2014 Posted December 4, 2014 http://www.cadtutor.net/forum/showthread.php?89186-Movebak&p=610918&viewfull=1#post610918 (defun C:bak (/ fn path dwg) ;v1.1 (if (setq fn (getfiled "Select file" (getvar "tempprefix") "sv$;bak;dwg" 2)) (setq path (strcat (vl-filename-directory fn) "\\") dwg ([color="blue"]vl-filename-mktemp[/color] [color="red"]"george_"[/color] path ".dwg") ; <--- example george fn (if (/= (strcase (vl-filename-extension fn)) ".DWG") ([color="blue"]vl-file-copy[/color] fn dwg t) dwg ) ;_ end of if ) ;_ end of setq (princ "Failed! *cancel*") ) ;if (terpri) (if path (command "shell" (strcat "explorer \"" path)) ) ; optional: open the destination folder (princ) ) ;bak my apology vl-file-copy to avoid conflict. Dear hanhphuc. good idea , only rename ? open the temp folder ? I think can rename it ,and open it ? no need open the temp folder. Quote
hanhphuc Posted December 4, 2014 Posted December 4, 2014 (edited) dwg (vl-filename-mktemp "george_" path ".dwg") ; <--- example george 1) Is it posiible to keep (the original name of the file _backup.dwg) and nor george001.dwg 2) if the file needs recover can we add a command to do it ? Thanks 1) george_ replaced (vl-filename-mktemp [color="red"](strcat (vl-filename-base fn) "_")[/color] path ".dwg") 2) i dont really understand comment, the routine just create new dwg name (not rename), so i think no conflict. you can keep or delete it safely Dear hanhphuc.good idea , only rename ? open the temp folder ? I think can rename it ,and open it ? no need open the temp folder. replace this [color="#696969"](if path (command "shell" (strcat "explorer \"" path)) ) ; optional: open the destination folder [/color] to [color="red"] (if path (vla-open (vla-get-Documents (vlax-get-Acad-Object)) dwg :vlax-false))[/color] ;<-- MDI mode make sure (vl-load-com) Edited December 4, 2014 by hanhphuc Quote
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.