- (defun c:DY (/ as fx mp p1 p2 pp sn snap vdi) ;简单打印
- (setvar "cmdecho" 0) ;指令执行过程不响应
- (setq snap (getvar "osmode"))
- (setvar "osmode" 0)
- (setvar "osmode" 1)
- (setq pn "\\\\OEM-20170510YNK\\HP LaserJet 1020");打印机 原名称\\HP LaserJet 1020
- (setq px "A4 210 x 297 毫米");纸张大小
- (setq AS 1);打印的页数为1页
- (setq VDI 100) ; 横向两页间距为100,可以一次打印多页,根据需求自己改吧
- (setq P1 (getpoint "\n图形左上角: "))
- (setq P2 (getcorner p1 "\n图形右下角: "))
- (setq fx (if(>(apply '-(mapcar 'abs(mapcar '- p1 p2)))0)"L" "P"))
- (setq sn 0)
- (while (/= sn AS)
- (setq PP (polar p1 0 (* VDI sn)))
- (setq MP (polar p2 0 (* VDI sn)))
- (setq sn (+ sn 1))
- (command "-PLOT" "y" "" pn px "M" fx "N" "W" PP MP "f" "C" "y" "monochrome.ctb" "N" "W" "N" "N" "y"))
- (command "-plot" "y" "model" "" "" "Millimeters" orientation "no" "w" minp maxp "fit" "c" "y" "" "y" "n" "n" "n" "y")
-
- (setvar"osmode" snap);恢复捕捉
- (princ)
- )
|