近期内写的这样一个小功能增加打印花样. 但在使用在并不是很好. 希望各位大侠提点一下如何更进.
是这么样的,我不知怎么在几个打印框中的图减去选取定打印框的步骤呢?是减少这步不用去选取打印的边框(距形框)
(IF (> (SSLENGTH A) 1)
(SETQ a (ENTSEL "\n發現圖中有多個和打印框屬性相同的框框, 請麻煩選擇打印的邊界框框:")
AX(CAR a)
ac(ENTGET AX))
(SETQ AS (SSNAME A 0)
ac (ENTGET AS)
AF (CDR (ASSOC 10 AD))))
我写的程序如下:
;;運行程序事先準備工作: 1. 如沒有程序指定的打印機要增加, 本程序指向的是75686B.PC3
;;功能; 只打印邊界框內程序所選的實體.
;;
(defun c:plotone()
(setvar "cmdecho" 0)
(setq os(getvar "osmode" ))
(setvar "osmode" 0)
(princ "請選擇要打印的實體:")
(setq plot (ssget))
(command ".layer" "f" "L_0" "" "")
(setq a (ssget "x" '((0 . "LWPOLYLINE") (62 . 6)))); 打印邊界框
(IF (= a nil)
(progn (ALERT "當前沒有打印邊界框, 要終止......
\n本訊息由系統自動提示.") (exit)))
(IF (> (SSLENGTH A) 1)
(SETQ a (ENTSEL "\n發現圖中有多個和打印框屬性相同的框框, 請麻煩選擇打印的邊界框框:")
AX(CAR a)
ac(ENTGET AX))
(SETQ AS (SSNAME A 0)
ac (ENTGET AS)
AF (CDR (ASSOC 10 AD))))
(setq n 0)
(repeat (length ac)
(setq qend (nth n ac))
(if (= (car qend) 10)
(setq one (cdr qend))
(setq n (1+ n))))
(setq tow (cdr (nth (+ n 4) ac)))
(setq trhee (cdr (nth (+ n 8) ac)))
(setq fou (cdr (nth (+ n 12) ac)))
(command ".erase" a "")
(setq la (getvar "clayer"))
(setvar "clayer" "0")
(command ".erase" "all" "r" plot "")
(command ".layer" "f" "AID" "")
(command ".layer" "f" "L_0" "")
( command ".plot" "y" "" "7586B.pc3" "ISO A4 (297.00 x 210.00 MM)" "m" "L" "N" "w" one trhee
"1=1" "0,0" "" "" "" "N" "N" "Y" "");;打印啦
(command ".undo" 7)
(entmake ac)
(setvar "cmdecho" 1) (setvar "osmode" os) (setvar "clayer" la)
(princ))