wanhongron
发表于 2012-6-18 18:56:48
尤其重谢langjs大侠,考虑得非常周到,无微不至!
ps122hb
发表于 2012-6-19 08:24:58
wanhongron 发表于 2012-6-18 18:40 static/image/common/back.gif
谢谢langjs大侠和院长的指教,已经达到我要的效果了,非常感谢!
直接用他们的程序就行了还是另有改动?
669423907
发表于 2012-7-14 08:52:11
langjs 发表于 2012-6-18 10:05 static/image/common/back.gif
;;; 快速打印程序,选一堆矩图框,再批量打印
(defun c:ksdy (/ ent fx i maxpoint maxx0 maxy0 minpoint mi ...
langjs大师是否方便在以下批打程序里加上你矩形的对角线啊?
这个程序可以框选的。非常感谢你。
;横打
(defun c:dq()
(setvar "cmdecho"0)
(setq ss(ssget '((8 . "黑色打印框"))))
(setq n 0)
(repeat (sslength ss)
(setq en (ssname ss n))
(setq obj (vlax-ename->vla-object en))
(vla-GetBoundingBox obj 'minpt 'maxpt)
(setq minPt (vlax-safearray->list minPt))
(setq maxPt (vlax-safearray->list maxPt))
(setq minptx (car minpt))
(setq minpty (cadr minpt))
(setq maxptx (car maxpt))
(setq maxpty (cadr maxpt))
(if (< (- maxptx minptx) (- maxpty minpty))
(dayin2 minpt maxpt)
(dayin1 minpt maxpt))
(setq n (1+ n)))(PRINC))
(defun dayin1(p1 p2)
(command "_plot" "y" "模型" "\Canon iP1100 series" "A4" "M" "L" "y" "W" P1 P2 "F" "C" "Y" "acad.ctb" "y" "a" "n" "y""y"))
xujinhua
发表于 2012-7-14 19:40:37
学习了....准备学这个
dafeilang
发表于 2012-10-26 14:58:56
CAD2010
(command "_.PLOT" "Y" "" "pdffactory pro" "A3" "M" fx "N" "W" pmin pmax "F" "C" "Y" "monochrome.ctb" "Y" "N" "N" "N" "Y")
不认输入的 "A3" ,手输入-PLOT命令认"A3 (297 x 420 毫米)",在LisP里面又不认了 不知道怎么回事
clh521
发表于 2012-10-27 00:44:09
正好需要这个程序
clh521
发表于 2012-10-30 00:58:58
669423907 发表于 2012-7-14 08:52 static/image/common/back.gif
langjs大师是否方便在以下批打程序里加上你矩形的对角线啊?
这个程序可以框选的。非常感谢你。
改一个字母,就可以框选:
;;; 快速打印程序,选一堆矩图框,再批量打印
(defun c:ksdy (/ ent fx i maxpoint maxx0 maxy0 minpoint minx0 miny0 os pmax pmin ptlist ss sstk)
(vl-load-com)
(setvar "cmdecho" 0) (setq os (getvar "osmode") ss (ssadd) sstk (ssadd))
(princ "\n 请选取矩形图框:")
(while (setq ss (ssget ":S" (list '(0 . "LWPOLYLINE") '(90 . 4))))
;(while (setq ss (ssget (list '(0 . "LWPOLYLINE") '(90 . 4))))
(setq ent (ssname ss 0))
(vla-getboundingbox (vlax-ename->vla-object ent) 'minpoint 'maxpoint)
(setq pmax (vlax-safearray->list maxpoint)pmin (vlax-safearray->list minpoint)
minx0 (car pmin)miny0 (cadr pmin) maxx0 (car pmax)maxy0 (cadr pmax))
(if (>= (- maxx0 minx0) (- maxy0 miny0)) (setq fx "L") (setq fx "P") )
;;;生成矩形的对角线并将对角线加入选择集sstk
(entmake (list '(0 . "LINE") (cons 62 6) (cons 10 (list minx0 miny0 0)) (cons 11 (list maxx0 maxy0 0))))
(setq sstk (ssadd (entlast) sstk))
(entmake (list '(0 . "LINE") (cons 62 6) (cons 10 (list minx0 maxy0 0)) (cons 11 (list maxx0 miny0 0))))
(setq sstk (ssadd (entlast) sstk))
;;;生成矩形的对角线并将对角线加入选择集sstk结束
(setq ptlist (cons (list pmin pmax fx) ptlist))
)
(initget "Y N ")
(if (/= (getpoint (strcat "\n 确定批量打印?[确认(Y)/退出(N)]:<Y> ")) "N")
(progn
(command "erase" sstk "")
(repeat (setq i (length ptlist))
(setq ent (nth (setq i (1- i)) ptlist )pmin (car ent) pmax (cadr ent) fx (last ent))
(command "_.PLOT" "Y" "" "Adobe PDF" "A3" "M" fx "N" "W" pmin pmax "F" "C" "Y" "monochrome.ctb" "Y" "N" "N" "N" "Y")
(princ (strcat "\n 程序正在打印第" (itoa (- (length ptlist) i)) "张>>>>>>>> "))
)
)
(command "erase" sstk "")
)
(setvar "osmode" os) ; 恢复捕捉模式
(princ)
)
sunny_8848
发表于 2018-1-27 10:27:05
这个批量打印不错,多谢分享
sunny_8848
发表于 2018-2-19 21:20:02
要是能有打印机列表选择打印机,而不是直接指定Adobe PDF就完美了
不语勿语
发表于 2018-3-15 22:32:39
先收入待用。。。