请高手相助!选择含分号的字符串,将分号“;”前后的文字互换
本帖最后由 xuzhigangrene 于 2013-6-26 17:23 编辑如题!
如:B4f22;T3f20变成T3f20;B4f22 (defun AYL-ssClist (ss / EnLst n)
(setq EnLst nil)
(repeat (setq n (sslength ss))
(setq EnLst (cons (ssname ss (setq n (1- n))) EnLst))
)
)
(defun AYL-UMString (String Sustr / StrLst n Sustr0)
(setq StrLst nil)
(while (setq n (vl-string-search Sustr String))
(setq Sustr0 (substr String 1 n)
String (substr String (+ n (strlen Sustr) 1))
StrLst (cons Sustr (cons Sustr0 StrLst))
)
)
(apply 'strcat (cons String StrLst))
)
(defun c:tt (/ EntLst)
(if (setq ss (ssget '((0 . "*Text"))))
(progn
(setq EntLst (AYL-ssClist ss)
ss nil
)
(mapcar
(function
(lambda (x / a b)
(setq a (entget x)
b (assoc 1 a)
)
(entmod (subst (cons 1 (AYL-UMString (cdr b) ";")) b a))
)
)
EntLst
)
)
)
(princ)
) 这个插件不好弄吗?各位大神帮帮忙吧~ nzl1116 发表于 2013-6-26 19:20 static/image/common/back.gif
很好用,满足了我的要求 nzl1116 发表于 2013-6-25 16:40 static/image/common/back.gif
感謝 nzl1116 分享程序!
页:
[1]