AutoCAD经常崩溃有木有?要去临时文件夹去找sv$改成dwg,有木有?每次都要去找临时文件夹烦不烦?
在桌面生成sv$todwg文件夹,并把临时文件夹中的sv$文件复制到改文件夹,并改后缀名为dwg,懒人用的  - ;;;使用 Lisp 函数时,如果目录路径过长,“vl-directory-files”可能会导致 AutoCAD 变得不稳定。
- ;;;(vl-directory-files (getvar "tempprefix") "*.sv$")
- (defun c:fix ( / desktopPath my_startapp tmpfilepath)
- (setq desktopPath
- (vl-registry-read "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" "Desktop")
- )
- (defun my_startapp (strings / obj_wsh)
- (setq obj_wsh (vlax-create-object "wscript.shell"))
- (vlax-invoke obj_wsh 'run strings 0 0)
- (vlax-release-object obj_wsh)
- )
- (setq tmpfilepath (strcat desktopPath "\\sv$todwg"))
- (if (not (findfile tmpfilepath)) (vl-mkdir tmpfilepath))
- (my_startapp (strcat "cmd /c copy " (getvar "tempprefix") "*.sv$" " " tmpfilepath "\\*.dwg"))
- (my_startapp (strcat "cmd /c copy " (getvar "savefilepath") "\\*.sv$" " " tmpfilepath "\\*.dwg"))
- (my_startapp (strcat "cmd /c copy " (getvar "savefilepath") "\\*.bak" " " tmpfilepath "\\*.dwg"))
- (princ)
- )
|