- UID
- 1659
- 积分
- 1399
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-22
- 最后登录
- 1970-1-1
|
发表于 2003-2-16 11:45:16
|
显示全部楼层
对标高文字的的要求,不大于200,小于-50,可在程序中自行修改。
要求标高文字在小数点后有二位或三位。
;;;标高差值统一加减 "上下各"
(defun c:bgs()
(setq zzs 0)
(setq bgd (getreal "\n标高差值:"))
(if (or (/= bgd 0.0)(not bgd))
(setq ee (ssget '((-4 . "<OR")(0 . "mtext")(0 . "text")(-4 .
"OR>"))))
(setq ee nil)
)
(if ee
(progn
(setq a1 0)
(while (setq e1 (ssname ee a1))
(setq a1 (1+ a1))
(setq e (entget e1))
(setq et (cdr (assoc '1 e)))
(if (wcmatch et
"##`.###,#`.###,-#`.###,###`.###,-##`.###,##`.##,#`.##,-#`.##,###`.##,-##`.##")
(progn
(setq ez (read et))
(if (< -50.00 ez 200.00)
(progn
(setq ez (+ ez bgd))
(setq et (t-tr ez))
(setq e (subst (cons 1 et)(assoc '1 e) e))
(entmod e)(setq zzs (1+ zzs))
)
)
)
)
)
)
)
(princ "\n共")(princ zzs)(princ "个标高修改.")
(princ)
)
(defun t-tr( a / b )
(setq b (rtos a 2 3))
(cond
( (wcmatch b "*`.") (setq b (strcat b "000")) )
( (wcmatch b "*`.#") (setq b (strcat b "00")) )
( (wcmatch b "*`.##") (setq b (strcat b "0")) )
( (wcmatch b "*`.###") t )
( (not (wcmatch b "*`.*")) (setq b (strcat b ".000")) )
)
(setq b b)
)
(princ "\nTYPE C:BGS To Run .")
(princ)
|
|