一次改园小程序
冒个自己的小做作.见笑:D一次改园.
(defun c:gg ( / dxcircle n cx ename elist)
(setq temperr *error*)
(setq *error* abbtrap)
(setq old1 (getvar "blipmode"))
(setq cmd (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq dxcircle (ssget '((0 . "CIRCLE"))));选择园
(if dxcircle nil
(exit))
(princ "\n输入直径(");输入直径
(if (/= 2r nil)(princ 2r))(princ "):")
(setvar "osmode" 16)
(setq d (getdist))
(setvar "osmode" 183)
(if (= d nil)
(setq d 2r))
(setq 2r d)
(setq n (sslength dxcircle))
(setq cx 0)
(repeat n
(setq ename (ssname dxcircle cx))
(setq elist (entget ename))
(setq elist (subst (cons 40 (* d 0.5)) (assoc 40 elist) elist));修改选择园的大小
(entmod elist)
(setq cx (+ cx 1))
)
(prompt (strcat "以处理" (itoa n) "个圆"))
(setq *error* temperr)
(setvar "cmdecho" cmd)
)
(defun abbtrap (errmsg);错误处理
(setvar "blipmode" old1)
(setvar "pickfirst" 1)
(setvar "cmdecho" cmd)
(setvar "osmode" 183)
(setq *error* temperr)
(princ)
) 顶一下,看看好不好用 看看对我用没 回复 1# caizeping
好好:victory: 点赞,辛苦了 版主辛苦了。 赞了再说,分享对于我们来说就是学习
页:
[1]