[灌水]你的文字样式有问题?这个小程序帮你解决。
<p>参考网友程序进行修改而成</p><p>(defun c:chtxsy ( / a b1 b2 e f index n ns zt)<br/> (setvar "cmdecho" 0)<br/> (command "purge" "a" "*" "n")<br/> (setq A (ssget "x" '((0 . "TEXT,MTEXT"))))<br/> (if (tblsearch "style" "XIAOLIN") <br/> (princ)<br/> (command "-style" "XIAOLIN" "txt.shx,hztxt.shx" "" "0.7" "" "" "" "")<br/> )<br/> (setvar "dimtxsty" "standard")<br/> (princ "正在处理中.....\n")<br/> (setq ns "XIAOLIN")<br/> (setq n (sslength a))<br/> (setq index 0)<br/> (repeat n<br/> (setq b1 (entget(ssname a index)))<br/> (setq index (+ index 1))<br/> (setq e (assoc 7 b1))<br/> (setq f (cons (car e) ns))<br/> (setq b2 (subst f e b1))<br/> (entmod b2)<br/> )<br/>(command "-style" "hztxt" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "chian" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "dim_font" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "1" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "ht" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "hz" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "romand" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "standard" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "yy" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "ro" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "style1" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "-黑体" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "simplex" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "h1" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "youyuan" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "hz" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "kt64f" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "lushu" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "kaiti" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "meihei" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "songti" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "zongyi" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "宋体" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "_simplex" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "att" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "dim" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "黑体" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "楷体" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "幼圆" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "华文" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "style2" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "style3" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "华文中宋" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "2" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "3" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "text" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "text1" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "text2" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "dim" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "dim1" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "dim2" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "_ht64f" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "_hzls" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "_txt" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "1" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "2" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "3" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "4" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "5" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "6" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "ht" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "_hzdx" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "_cibt____" "txt.shx,hztxt.shx" "" "" "" "" "" "") <br/>(command "-style" "comb" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "middle" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "_fds" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "_romanc" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "cg" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "fs1" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "_fs1" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "std" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "_fsj" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "fs" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "st" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "LP1" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "ROMANT" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "lp2" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "_HZTXT" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "_COMPLEX" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "-style" "complex" "txt.shx,hztxt.shx" "" "" "" "" "" "")<br/>(command "purge" "a" "*" "n")<br/>(princ "\n 字体转换成功!")<br/>(setvar "cmdecho" 1)<br/>(princ )<br/> )</p><p>;以方便各位解决字体问题。</p> <p>这样更简单</p><p></p><p>更换所有文字字体</p><p>(defun C:zas ()<br/> (graphscr)<br/> (initget 7)<br/> ;(setq c1 (getstring "\nInput new color for all layers: ")) ;输入新颜色<br/> (setq a1 (tblnext "style" t)) ;将指针移到第一个字体<br/> ; (princ a1)<br/> ;(setq a2 (cdr (assoc 2 a1))) ;取出图层名称<br/> ; (setq a3 (entget (tblobjname "style" a2))) ;取出图层的数据串行<br/> ; (princ " a3= ")(princ a3)<br/> (while a1<br/> (setq a2 (cdr (assoc 2 a1))) ;取出字体名称<br/> (setq a3 (entget (tblobjname "style" a2))) ;取出字体的数据串行<br/> ;(princ a3)(princ " ")<br/> (setq a3 (subst (cons 3 "txt_0.shx") (assoc 3 a3) a3)) ;将字体字型改成新字型<br/> (entmod a3)<br/> ;更新字体<br/> (setq a3 (subst (cons 4 "hzfs.shx") (assoc 4 a3) a3)) ;将字体字型改成新字型<br/> (entmod a3) <br/> (setq a1 (tblnext "style")) ;找出下一个字体<br/> )<br/> (command"REGEN" "")<br/> (princ"字型变更成功!" )<br/> (princ)<br/>)</p> 直接更改很方便;;;改所有字体为: rs,hztxt
(defun c:rshz (/ a3 ss j n ed)
(print "程序正在执行中,请稍后......")
(command "style" "hz" "rs.shx,hztxt.shx" "" "" "" "")
(setq a3 "hz")
(setq ss (ssget "x" (list (cons 0 "text"))))
(setq n (sslength ss))
(setq j 0)
(while (< j n)
(setq ed (ssname ss j))
(command "change" ed "" "" "" a3 "" "" "")
(setq j (+ j 1))
)
) 谢谢!学习了 不知道能不能更换多行文字字体哦,要是能够设置选择哪些字体更换成另外的字体就好了 谢谢各位,太好了 学习了,好贴子要顶起来 这种没有效率的搞法,让人昏!我有一次性将所有字型改为同一字体程序,我编制的,需要请联系
页:
[1]