(defun pFile (/ i WW cadobj version)
(setq i 0)
(cond
((= (getvar "acadver") "15.06")
(setq version "doslib2k.arx")
)
((= (getvar "acadver") "16.0s (LMS Tech)")
(setq version "doslib2004.arx")
)
) ;_ end of cond
(if (findfile version)
(arxload version)
(progn
(princ (strcat "\n找不到文件" version))
(exit)
) ;_ end of progn
) ;_ end of if
(setq cadobj (vlax-create-object "AUTOCAD.Application"))
(dos_progbar
"正在打印, 请等待..."
(vl-list-length filename)
) ;_ end of dos_progbar
(while (< i (vl-list-length filename))
(setq WW (vla-open (vla-get-documents cadobj)
(nth i filename)
) ;_ end of vla-open
) ;_ end of setq
(vla-SendCommand WW "(load \"klPrint\")\n")
(vla-SendCommand WW "klPrint\n")
(vla-sendcommand WW "qsave\n")
(vla-SendCommand WW "close\n")
(dos_progbar -1)
(setq i (+ i 1))
) ;_ end of while
(dos_progbar)
(vla-quit cadobj)
(arxunload version)
) ;_ end of defun