修改文字大小写的程序(源码)
(Defun c:xdx ( / case)(command "redraw")
(princ "\n修改文字的大小写,请选择文字")
(setq fil (ssget'((0 . "TEXT,MTEXT"))))
(setq case (getint "\n改成[小写(1)] <直接回车为大写>:"))
(setq len (sslength fil))
(setq n 0)
(while (<= n (- len 1))
(progn
(setq e (ssname fil n))
(cond
((= "TEXT" (cdr (assoc 0 (setq ed (entget e)))))
(progn
(setq ostr (cdr (assoc 1 ed)))
(setq nstr (strcase ostr case))
(setq ed (subst (cons 1 nstr) (assoc 1 ed) ed))
(setq n (+ 1 n))
(entmod ed)
))
((= "MTEXT" (cdr (assoc 0 (setq ed (entget e)))))
(progn
(setq ostr (cdr (assoc 1 ed)))
(setq nstr (strcase ostr case))
(setq lenstr (strlen nstr))
(setq m 1)
(while (< m lenstr)
(if (= "\\p" (substr nstr m 2))
(setq nstr (strcat (substr nstr 1 m) "\P" (substr nstr (+ 2 m))))
;(setq m (+ 1 m))
)
(setq m (+ 1 m))
)
(setq ed (subst (cons 1 nstr) (assoc 1 ed) ed))
(setq n (+ 1 n))
(entmod ed)
))
(T (setq n (+ 1 n)))
)
)
)
(princ)
);end defun
是源码的就要支持一下,好东西 I use Tcase of Express also. Thanks for sharing
谢谢分享 楼主厚道,是源码的就要顶! 顶起来 修改文字大小写的程序(源码) ,值得学习! 支持一个!!!路过 支持学习下 路过学习学习。谢谢分享! 好工具,要学习 谢谢分享