- ;; purge, zoom and saves all drawings in a folder
- ;; By Abbas Aqdam
- (defun C:PZT ( / path files dwg sf )
- (if (or (= (getvar "SDI") 0) (> (getvar "DBMOD") 0))
- (alert "Please: \n\n1-SAVE and close all open drawing!\n\n2-Set SDI to 0")
- (progn
- (setq path "C:\\TEST\")
- (setq files (vl-directory-files path "*.dwg" 1))
- (if (> (length files) 0)
- (progn
- (setq sf (open (strcat path "T.SCR") "w"))
- (write-line "Filedia" sf)
- (write-line "0" sf)
- (foreach dwg files
- (write-line "open" sf)
- (write-line (strcat """ path dwg """) sf)
- (write-line "(command "purge" "a" "*" "N")" sf)
- (write-line "(command "zoom" "e" "zoom" "s" "0.95x")" sf)
- (write-line "qsave" sf)
- );foreach
- (write-line "Filedia" sf)
- (write-line "1" sf)
- (close sf)
- (command "script" (strcat path "t.scr"))
- );progn
- (Alert (strcat "There is no dwg files in " path "!"))
- );if
- );progn
- );if
- );defun
希望我们可以使用编辑文本命令,而不是清除和缩放。。
正在等待答复。。 |