- (princ "\n梁编号加减数字=W_bhjj=【海盗曹跬步+13/2012.04.27】")
- (defun c:w_bhjj (/ a b c ss i e o str n p m x y z dxf text)
- (setq b (getstring "\n请选择类型<1=加/2=减>(默认为+):"))
- (setq c (getreal "\n请输入数字(默认为1):"))
- (setq ss (ssget '((0 . "TEXT") (1 . "*L* *x*,*L* *X*"))))
- (repeat (setq i (sslength ss))
- (setq e (ssname ss (setq i (1- i))))
- (setq dxf (entget e))
- (setq text (cdr (assoc 1 dxf)))
- (setq search (vl-string-search "LL" text))
- (if (/= search nil)
- (alert "\n!!!请注意!!!\n目前暂不支持连梁(LL)修改,请按确定退出\n除LL类其他编号已修改")
- (progn
- (setq o (vlax-ename->vla-object e))
- (setq str (vla-get-textstring o))
- (setq n (vl-string-position (ascii "L") str))
- (setq p (vl-string-position (ascii "(") str))
- (setq m (substr str (+ n 2) (- (- p n) 1)))
- (setq x (atof m))
- (if (= c nil)
- (setq c 1)
- )
- (if (= b "2")
- (setq y (- x c))
- (setq y (+ x c))
- )
- (setq a (fix y))
- (setq z (itoa a))
- (setq newstr (strcat (substr str 1 (+ n 1)) z (substr str
- (+ p 1)
- (strlen str)
- )
- )
- )
- (if (= b "2")
- (command "CHANGE" "p" "" "P" "c" "4" "")
- (command "CHANGE" "p" "" "P" "c" "1" "")
- )
- (vla-put-textstring o newstr)
- )
- )
- )
- (princ "\n梁编号加减数字=W_bhjj=【海盗曹跬步+13/2012.04.27】")
- (princ)
- )
|