合并打印lisp
你好我有2个lisp张贴在下面,一个用于打印pdf在纵向模式和另一个用于打印在横向模式。
是否可以将它们组合在一个lisp中。我的意思是,该程序可以自动检测选定对象(多段线)在纵向视图(210X297)或横向视图(297X210)中,并执行打印任务。
等待你有价值的回答。
; Batch plot using object in landscape mode a4 sheet
(defun c:prl (/ ss mn mx)
(setq num (getint "\nHow many plots to do ?:"))
(repeat num
(vl-load-com)
(if (setq ss(ssget "_:S:E" '((0 . "INSERT,LWPOLYLINE"))))
(progn
(vla-getboundingbox (vlax-ename->vla-object (ssname ss 0)) 'mn'mx)
(command "-plot" "Y" "model" "ABXPDF Writer.pc3" "A4" "Millimeters" "Landscape" "Y" "Window" (trans (vlax-safearray->list mn) 0 1)
(trans (vlax-safearray->list mx) 0 1)
"Fit" "0.00, 0.00" "Y" "monochrome.ctb" "Y" "Wireframe" "N" "N" "Y")
)
)
)
)
; Batch plot using object in portrait mode a4 sheet
(defun c:prp (/ ss mn mx)
(setq num (getint "\nHow many plots to do ?:"))
(repeat num
(vl-load-com)
(if (setq ss(ssget "_:S:E" '((0 . "INSERT,LWPOLYLINE"))))
(progn
(vla-getboundingbox (vlax-ename->vla-object (ssname ss 0)) 'mn'mx)
(command "-plot" "Y" "model" "ABXPDF Writer.pc3" "A4" "Millimeters" "Portrait" "N" "Window" (trans (vlax-safearray->list mn) 0 1)
(trans (vlax-safearray->list mx) 0 1)
"Fit" "0.00, 0.00" "Y" "monochrome.ctb" "Y" "Wireframe" "N" "N" "Y")
)
)
)
)
; Batch plot using object in landscape mode a4 sheet
(defun prl ( mnp mxp / num )
(setq num (getint "\nHow many plots to do ?: "))
(repeat num
(command "-plot" "Y" "model" "ABXPDF Writer.pc3" "A4" "Millimeters" "Landscape" "Y" "Window" mnp mxp "Fit" "0.00, 0.00" "Y" "monochrome.ctb" "Y" "Wireframe" "N" "N" "Y")
)
)
; Batch plot using object in portrait mode a4 sheet
(defun prp ( mnp mxp / num )
(setq num (getint "\nHow many plots to do ?: "))
(repeat num
(command "-plot" "Y" "model" "ABXPDF Writer.pc3" "A4" "Millimeters" "Portrait" "N" "Window" mnp mxp "Fit" "0.00, 0.00" "Y" "monochrome.ctb" "Y" "Wireframe" "N" "N" "Y")
)
)
(defun c:pr ( / ss mn mx mnp mxp )
(vl-load-com)
(if (setq ss (ssget "_:S:E" '((0 . "INSERT,LWPOLYLINE"))))
(progn
(vla-getboundingbox (vlax-ename->vla-object (ssname ss 0)) 'mn 'mx)
(setq mnp (trans (vlax-safearray->list mn) 0 1))
(setq mxp (trans (vlax-safearray->list mx) 0 1))
(if (< (car (mapcar '- mxp mnp)) (cadr (mapcar '- mxp mnp)))
(prp mnp mxp)
(prl mnp mxp)
)
)
)
(princ)
)
HTH,M.R。 谢谢marko,你的代码适合我。
请删除这个“(setq num(getint“\n要做多少个绘图?:”)并将命令放入循环中,这样除非我们取消它,否则它不会结束吗?
我想知道,有没有其他的可能性,而不是一次选择一个对象,它可以选择多个对象,并保存在pdf的?
如果能做到这一点,我将非常感谢你的努力。
再次感谢。
页:
[1]