明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1047|回复: 1

[提问] 大侠们帮忙,以前申请的字符程序,现在好不用了

[复制链接]
发表于 2013-8-11 10:07:52 | 显示全部楼层 |阅读模式
(defun C:3x ()
(if (> (strlen (setq s1 (getstring "\nInput string 输入字符串 :"))) 0) (progn
  (if (wcmatch s1 "*.*") (setq s1 (chchar s1 "." "q")))
  (if (wcmatch s1 "*.*") (setq s1 (chchar s1 "." "q")))
  (if (wcmatch s1 "*q*") (setq s1 (chchar s1 "q" "}")))
  (if (wcmatch s1 "*q*") (setq s1 (chchar s1 "q" "}")))
  (if (wcmatch s1 "*-*") (setq s1 (chchar s1 "-" ";")))
  (if (and (setq s2 (entsel "\nSelect a text  选择文字 :"))
           (setq ent (entget(car s2)))
           (= (cdr (assoc 0 ent)) "TExT")) (progn
   (setq ent (subst (cons 1 s1) (assoc 1 ent) ent))
   (entmod ent)
  ))
))
(princ)
)  
(defun chchar (ss eqq wt / tmp i)
(setq i 1 tmp "")
(while (/= (setq s2 (substr ss i 1)) eqq) (setq tmp (strcat tmp s2) i (1+ i)))
(strcat tmp wt (substr s1 (1+ i)))
)
 楼主| 发表于 2013-8-11 12:25:03 | 显示全部楼层
其功能是
考虑到输入的方便,键盘输入的“.”在CAD里实际显示为“}”
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-5-26 13:10 , Processed in 0.181599 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表