求助高手指点,如何把这个lsp批量修改插件保存格式改成dxf(打开格式和保存格式都改成dxf。原dwg)- (defun c:tt (/ f file tmp)
- (setq f (getfiled "选择文件夹并任意选取一个文件,请先剔除无需处理文件"
- "d:\"
- "dwg"
- 0
- )
- f (vl-filename-directory f)
- f (mapcar '(lambda (x) (strcat f "\" x))
- (vl-directory-files f "*.dwg" 1)
- )
- )
- (setq tmp (open (setq file (strcat (getenv "TEMP") "\\tmp.scr")) "w"))
- (foreach n f
- (write-line (strcat "_.open "" n """) tmp)
- (write-line
- "(setq ss (ssget "x" '((0 . "CIRCLE") )))
- (repeat (setq n (sslength ss))
- (setq en (ssname ss (setq n (1- n))))
- (setq centerpt(Cdr(Assoc 10 (Entget en))))
- (entmake (list '(0 . "LINE") (cons 10 (polar centerpt pi 5 )) (cons 11 (polar centerpt 0 5 ))))
- (entmake (list '(0 . "LINE") (cons 10 (polar centerpt ( * 0.5 pi) 5 )) (cons 11 (polar centerpt ( * -0.5 pi) 5 )))))"
- tmp
- )
- (write-line "_.qsave _.close" tmp)
- )
- (close tmp)
- (command ".script" file)
- (vl-file-delete file)
- (princ)
- )
|