嗨,我有一些代码,我想批量清除图形,使用doslib函数。
它不起作用,中途停了下来。我想可能还有更多
不止一个错误。有人能修一下吗?
ps我想保留doslib函数谢谢
- (defun c:BatchPurge
- (/ UserFile UserCat DirPath FileList File#1 DwgName FileName)
- (vl-load-com)
- (setq DirPathdefault (getvar "dwgprefix"));Current folder
- (setq DirPath (dos_getdir "Browse for a Drawing folder"
- DirPathdefault "Select a folder to clean drawing files")
- )
- (if (= DirPath nil)
- (exit)
- (setq DwgLst (vl-directory-files DirPath "*.dwg" 1));list of drawings in folder
- );if
- ;Create list of all *.dwg files in selected Directory
- (setq DwgtoCleanLst(dos_multilist "Select Files" "Select which Drawings to purge." DwgLst));list of drawings selected
-
- (setq File#1 (open "c:/Documents and Settings//rxbeeto0//BatchClean.scr" "w"))
- ;; open/make a scriptfile to write to
- (foreach DwgName DwgtoCleanLst
- (setq FileName (strcat """ DirPathdefault "\" DwgName """))
- (princ "open\n" FileName)
- (princ (strcat FileName "\n") FileName)
- (princ "purge\n" File#1)
- (princ "all\n\n" File#1)
- (princ "_.qsave\n" FileName)
- (princ "_.close\n" FileName)
- )
- (close FileName)
- (command "script" "C:\\Documents and Settings\\rxbeeto0\\BatchClean.scr")
- (princ)
- );defun
|