zyhandw
发表于 2012-9-25 15:41:03
这么个小程序对你来说应该不是什么难题啊,简单写了下,你自己调试再改下!(defun c:een()
(setq n 0)
(if (setq ss (ssget '((0 . "text"))))
(repeat (sslength ss)
(setq txt-lst (entget (ssname ss n)))
(setq txt-str (cdr (assoc '1 txt-lst)))
(setq sec (substr txt-str (strlen txt-str)))
(setq firs (substr txt-str '1 (- (strlen txt-str) 1)))
(setq sec-i-str (itoa (+ (atoi sec) 1)))
(setq txt-str (strcat firs sec-i-str))
(setq txt-lst (subst (cons '1 txt-str) (assoc '1 txt-lst) txt-lst))
(entmod txt-lst)
(setq n (1+ n))
)
)
(princ)
)
半听可乐
发表于 2012-9-25 15:47:58
Andyhon 发表于 2012-9-25 15:31 static/image/common/back.gif
(setq ss (ssget "X" '((0 . "TEXT") (1 . "*-#")))
===>
(setq ss (ssget '((0 . "TEXT") (1 . "* ...
非常感谢!这样的功能真是太方便了!
半听可乐
发表于 2012-9-25 15:50:10
Andyhon 发表于 2012-9-25 15:31 static/image/common/back.gif
(setq ss (ssget "X" '((0 . "TEXT") (1 . "*-#")))
===>
(setq ss (ssget '((0 . "TEXT") (1 . "* ...
为了方便其他朋友,我把完整程序附上,谢谢Andyhon长老!
;;;-------------------------------------------------------------------------------------------------------------------
;;; ★gws改尾数
;;; ByAndyhon
;;;-------------------------------------------------------------------------------------------------------------------
(defun C:gws()
(setq ss (ssget '((0 . "TEXT") (1 . "*#")))
Num (getstring "\n新的编号: ")
i0
)
(while (setq ee (ssname ss i))
(setq obj (vlax-ename->vla-object ee)
txt (vla-get-textstring obj)
txt (reverse (vl-string->list txt))
txt (vl-list->string (reverse (cdr txt)))
i (1+ i)
)
(vla-put-textstring obj (strcat txt Num))
)
)
lty
发表于 2012-9-25 17:39:06
哈哈,又长知识了!
crazylsp
发表于 2012-9-26 13:04:47
;_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
;试用
;递增1按+
;递减1按-
(defun een()
(setq n 0)
(repeat (sslength (ssget "P"))
(setq txt-lst (entget (ssname ss n)))
(setq txt-str (cdr (assoc '1 txt-lst)))
(setq sec (substr txt-str (strlen txt-str)))
(setq firs (substr txt-str '1 (- (strlen txt-str) 1)))
(setq sec-i-str (itoa (+ (atoi sec) 1)))
(setq txt-str (strcat firs sec-i-str))
(setq txt-lst (subst (cons '1 txt-str) (assoc '1 txt-lst) txt-lst))
(entmod txt-lst)
(setq n (1+ n))
)
(princ)
)
(defun eem()
(setq n 0)
(repeat (sslength (ssget "P"))
(setq txt-lst (entget (ssname ss n)))
(setq txt-str (cdr (assoc '1 txt-lst)))
(setq sec (substr txt-str (strlen txt-str)))
(setq firs (substr txt-str '1 (- (strlen txt-str) 1)))
(setq sec-i-str (itoa (- (atoi sec) 1)))
(setq txt-str (strcat firs sec-i-str))
(setq txt-lst (subst (cons '1 txt-str) (assoc '1 txt-lst) txt-lst))
(entmod txt-lst)
(setq n (1+ n))
)
(princ)
)
(vl-load-com)
(defun c:tt()
(if(setq ss (ssget '((0 . "text"))))
(repeat 88
(if (and (=(car(grread))2)(= (cadr(grread))43))
(een)
)
(if(and (=(car(grread))2)(= (cadr(grread))45))
(eem)
)
)
)
)
;
;_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
;
半听可乐
发表于 2012-9-26 17:01:15
crazylsp 发表于 2012-9-26 13:04 static/image/common/back.gif
;_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
;试用
;递增1按+
...
不管用~没反应 的
crazylsp
发表于 2012-9-26 17:47:12
多按几次就可以了。
aaacjh
发表于 2012-9-28 21:53:26
本帖最后由 aaacjh 于 2012-9-28 21:54 编辑
crazylsp 发表于 2012-9-26 17:47 http://bbs.mjtd.com/static/image/common/back.gif
多按几次就可以了。
是诶,多按几次才有反应.思路学习前辈.请教前辈! getread 函数针对键盘输入(2),是否有个对于表可供查询?
aaacjh
发表于 2012-9-28 22:09:12
半听可乐 发表于 2012-9-25 15:50 static/image/common/back.gif
为了方便其他朋友,我把完整程序附上,谢谢Andyhon长老!
;;;-------------------------------------- ...
vla-get-textstring 像这种vla开头的是什么函数,请教!,在常规的帮助文件中查不到.
aaacjh
发表于 2012-9-28 22:11:23
Andyhon 发表于 2012-9-25 14:43 static/image/common/back.gif
是让您自行参考后修订
这样试吧!
vla-get-textstring 像这种vla开头的是什么函数,请教!,在常规的帮助文件中查不到.