本帖最后由 htlaser 于 2021-1-26 11:39 编辑
- (defun c:opp (/ as fx mp p1 p2 pp sn snap vdi) ;简单打印
- (setvar "cmdecho" 0) ;指令执行过程不响应
- (setq snap (getvar "osmode"))
- (setvar "osmode" 0)
- (setvar "osmode" 1)
- (setq pn "\\\\PC-20160516EGUD\\EPSON L360 Series");打印机 原名称\\PC-20160516EGUD\EPSON L360 Series
- (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"))
- (setvar"osmode" snap);恢复捕捉
- (princ)
- )
原帖:http://bbs.mjtd.com/forum.php?mo ... hlight=%B4%F2%D3%A1
|