|
;;;更改线的宽度
;;;本程序只线.多义线.圆.圆弧适用
;;;2003.08.08 by Mr.zhong
(defun cno(/ ss pw entyp rr cen)
(setvar "cmdecho" 0)
(setq ss (entsel "\n选择线/多义线/圆/圆弧:"))
(while (= ss nil)
(setq ss (entsel "\n选择线/多义线/圆/圆弧:"))
)
(setq pw (getdist "\n点选或输入宽度:"))
(if (= pw nil) (setq pw 0))
(setq entyp (cdr (assoc 0 (entget (car ss)))))
(cond ((= entyp "LINE") (command "pedit" ss "y" "w" pw ""))
((= entyp "ARC") (command "pedit" ss "y" "w" pw ""))
((= entyp "LWPOLYLINE") (command "pedit" ss "w" pw ""))
((= entyp "CIRCLE")
(setq rr (cdr (assoc 40 (entget (car ss)))))
(while (> pw rr)
(prompt "\n你的宽度大于圆或圆弧的半径,重新输入...")
(setq pw (getdist "\n点选或输入宽度:"))
)
(setq cen (trans (cdr (assoc 10 (entget (car ss)))) 0 1))
(command "donut" (* 2 (- rr (/ pw 2))) (* 2 (+ rr (/ pw 2))) cen "")
(command "erase" ss "")
)
)
(while (/= ss nil)
(setq ss (entsel "\n选择线/多义线/圆/圆弧:"))
(while (= ss nil)
(setq ss (entsel "\n选择线/多义线/圆/圆弧:"))
)
(setq entyp (cdr (assoc 0 (entget (car ss)))))
(cond ((= entyp "LINE") (command "pedit" ss "y" "w" pw ""))
((= entyp "ARC") (command "pedit" ss "y" "w" pw ""))
((= entyp "LWPOLYLINE") (command "pedit" ss "w" pw ""))
((= entyp "CIRCLE")
(setq rr (cdr (assoc 40 (entget (car ss)))))
(while (> pw rr)
(prompt "\n你的宽度大于圆或圆弧的半径,重新输入...")
(setq pw (getdist "\n点选或输入宽度:"))
)
(setq cen (trans (cdr (assoc 10 (entget (car ss)))) 0 1))
(command "donut" (* 2 (- rr (/ pw 2))) (* 2 (+ rr (/ pw 2))) c
en "")
(command "erase" ss "")
)
)
)
(princ)
)
本程序循环的这一段和退出写的不太好,要强行退出.
大家如有需要可和我E_MAIL联系.ZYS@ROSSMAX.COM.TW
望大家多多指点.谢谢. |
|