保存前使用这个程序看看。。。
命令:bsave
- (defun saveas2000(filename docs / doc)
- (setq doc (vla-open docs filename))
- (vla-saveas doc filename acR15_DWG)
- (vla-close doc)
- )
- (defun c:BSave( / docs ss i files files2 filename file ent blkname)
- (setq docs (vla-get-documents (vlax-get-acad-object)))
- (setq ss (ssget "x" '((0 . "INSERT"))))
- (setq i 0)
- (setq files nil)
- (repeat (sslength ss)
- (setq ent (ssname ss i))
- (setq blkname (cdr (assoc 2 (entget ent))))
- (setq filename (cdr (assoc 1 (tblsearch "block" blkname))))
- (if filename
- (setq files (append files (list filename)))
- )
- (setq i (1+ i))
- )
- (setq i 0)
- (repeat (length files)
- (setq file (nth i files))
- (if (not (member file files2))
- (setq files2 (append files2 (list file)))
- )
- (setq i (1+ i))
- )
- (setq i 0)
- (repeat (length files2)
- (saveas2000 (nth i files2) docs)
- (setq i (1+ i))
- )
- (princ)
- )
|