wuxuloveguo 发表于 2009-2-11 10:01:00

<p>caoyin斑竹在不,麻烦你了!</p>

caiqs 发表于 2009-2-11 12:49:00

<p></p><p>;;;师兄 QQ361865648,简单的写了一个,测试的回显如下</p><p>;;;命令:<br/>;;;命令: test</p><p>;;;请输入要查找的字符,以短号隔开,可以使用通匹符: *str,545*</p><p>;;;命令:</p><p></p><p>(defun c:test ()<br/>&nbsp; (setq&nbsp;searchstr (getstring<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "\n请输入要查找的字符,以短号隔开,可以使用通匹符: "<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp; )<br/>&nbsp; (SETQ&nbsp;STRLST<br/>&nbsp; (READ<br/>&nbsp;&nbsp;&nbsp; (STRCAT<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "("<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (VL-LIST-&gt;STRING (subst 32 44 (VL-STRING-&gt;list searchstr)))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ")"<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp; )<br/>&nbsp; )<br/>&nbsp; (setq strlst(mapcar 'VL-SYMBOL-name strlst))<br/>&nbsp; (SETQ&nbsp;N 0<br/>&nbsp;NEWLST NIL<br/>&nbsp; )<br/>&nbsp; (REPEAT (LENGTH STRLST)<br/>&nbsp;&nbsp;&nbsp; (SETQ SS NIL<br/>&nbsp;&nbsp; J&nbsp; 0<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; (setq searchstr (nth n strlst))<br/>&nbsp;&nbsp;&nbsp; (SETQ SS (SSGET "X"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (LIST (CONS 0 "*TEXT")<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons -4 "&lt;or")<br/>&nbsp;&nbsp;&nbsp;&nbsp; (CONS 1 (strcase searchstr))<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 1 (strcase searchstr t))<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons -4 "or&gt;")<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; )</p><p><br/>&nbsp;&nbsp;&nbsp; (SETQ N (1+ N))<br/>&nbsp;&nbsp;&nbsp; (IF&nbsp;SS<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SETQ J (SSLENGTH SS))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SETQ J 0)<br/>&nbsp;&nbsp;&nbsp; )</p><p>&nbsp;&nbsp;&nbsp; (SETQ NEWLST (CONS J NEWLST))<br/>&nbsp; )<br/>&nbsp; (SETQ NEWLST (REVERSE NEWLST))<br/>&nbsp; (setq f (open "c:/temp.txt" "w"))<br/>&nbsp; (mapcar '(lambda (x y)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (WRITE-LINE</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (STRCAT<br/>&nbsp;&nbsp; x<br/>&nbsp;&nbsp; " 开头的 "<br/>&nbsp;&nbsp; (itoa y)<br/>&nbsp;&nbsp; " 个"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; F<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp; STRLST<br/>&nbsp;&nbsp; newlst<br/>&nbsp; )<br/>&nbsp; (close f)<br/>;;;&nbsp; (princ "\n已写入到临时文件 c:\\temp.txt")<br/>&nbsp; (startapp "notepad" "c:/temp.txt")<br/>&nbsp; (princ)<br/>)<br/></p>

caiqs 发表于 2009-2-11 12:53:00

<p>;;;命令测试</p><p>;;;命令:<br/>;;;命令: test</p><p>;;;请输入要查找的字符,以短号隔开,可以使用通匹符: *str,545*</p><p>;;;命令:</p><p><br/>;;;师兄 QQ 361865648<br/>(defun c:test ()<br/>&nbsp; (setq&nbsp;searchstr (getstring<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "\n请输入要查找的字符,以短号隔开,可以使用通匹符: "<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp; )<br/>&nbsp; (SETQ&nbsp;STRLST<br/>&nbsp; (READ<br/>&nbsp;&nbsp;&nbsp; (STRCAT<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "("<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (VL-LIST-&gt;STRING (subst 32 44 (VL-STRING-&gt;list searchstr)))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ")"<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp; )<br/>&nbsp; )<br/>&nbsp; (setq strlst(mapcar 'VL-SYMBOL-name strlst))<br/>&nbsp; (SETQ&nbsp;N 0<br/>&nbsp;NEWLST NIL<br/>&nbsp; )<br/>&nbsp; (REPEAT (LENGTH STRLST)<br/>&nbsp;&nbsp;&nbsp; (SETQ SS NIL<br/>&nbsp;&nbsp; J&nbsp; 0<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; (setq searchstr (nth n strlst))<br/>&nbsp;&nbsp;&nbsp; (SETQ SS (SSGET "X"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (LIST (CONS 0 "*TEXT")<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons -4 "&lt;or")<br/>&nbsp;&nbsp;&nbsp;&nbsp; (CONS 1 (strcase searchstr))<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 1 (strcase searchstr t))<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons -4 "or&gt;")<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; )</p><p><br/>&nbsp;&nbsp;&nbsp; (SETQ N (1+ N))<br/>&nbsp;&nbsp;&nbsp; (IF&nbsp;SS<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SETQ J (SSLENGTH SS))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SETQ J 0)<br/>&nbsp;&nbsp;&nbsp; )</p><p>&nbsp;&nbsp;&nbsp; (SETQ NEWLST (CONS J NEWLST))<br/>&nbsp; )<br/>&nbsp; (SETQ NEWLST (REVERSE NEWLST))<br/>&nbsp; (setq f (open "c:/temp.txt" "w"))<br/>&nbsp; (mapcar '(lambda (x y)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (WRITE-LINE</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (STRCAT<br/>&nbsp;&nbsp; x<br/>&nbsp;&nbsp; " 开头的 "<br/>&nbsp;&nbsp; (itoa y)<br/>&nbsp;&nbsp; " 个"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; F<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp; STRLST<br/>&nbsp;&nbsp; newlst<br/>&nbsp; )<br/>&nbsp; (close f)<br/>;;;&nbsp; (princ "\n已写入到临时文件 c:\\temp.txt")<br/>&nbsp; (startapp "notepad" "c:/temp.txt")<br/>&nbsp; (princ)<br/>)<br/></p><p>&nbsp;</p>

caiqs 发表于 2009-2-11 12:55:00

<p><br/>;;;师兄 QQ 361865648<br/>(defun c:test ()<br/>&nbsp; (setq&nbsp;searchstr (getstring<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "\n请输入要查找的字符,以短号隔开,可以使用通匹符: "<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp; )<br/>&nbsp; (SETQ&nbsp;STRLST<br/>&nbsp; (READ<br/>&nbsp;&nbsp;&nbsp; (STRCAT<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "("<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (VL-LIST-&gt;STRING (subst 32 44 (VL-STRING-&gt;list searchstr)))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ")"<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp; )<br/>&nbsp; )<br/>&nbsp; (setq strlst(mapcar 'VL-SYMBOL-name strlst))<br/>&nbsp; (SETQ&nbsp;N 0<br/>&nbsp;NEWLST NIL<br/>&nbsp; )<br/>&nbsp; (REPEAT (LENGTH STRLST)<br/>&nbsp;&nbsp;&nbsp; (SETQ SS NIL<br/>&nbsp;&nbsp; J&nbsp; 0<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; (setq searchstr (nth n strlst))<br/>&nbsp;&nbsp;&nbsp; (SETQ SS (SSGET "X"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (LIST (CONS 0 "*TEXT")<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons -4 "&lt;or")<br/>&nbsp;&nbsp;&nbsp;&nbsp; (CONS 1 (strcase searchstr))<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 1 (strcase searchstr t))<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons -4 "or&gt;")<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; )</p><p><br/>&nbsp;&nbsp;&nbsp; (SETQ N (1+ N))<br/>&nbsp;&nbsp;&nbsp; (IF&nbsp;SS<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SETQ J (SSLENGTH SS))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SETQ J 0)<br/>&nbsp;&nbsp;&nbsp; )</p><p>&nbsp;&nbsp;&nbsp; (SETQ NEWLST (CONS J NEWLST))<br/>&nbsp; )<br/>&nbsp; (SETQ NEWLST (REVERSE NEWLST))<br/>&nbsp; (setq f (open "c:/temp.txt" "w"))<br/>&nbsp; (mapcar '(lambda (x y)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (WRITE-LINE</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (STRCAT<br/>&nbsp;&nbsp; x<br/>&nbsp;&nbsp; " 开头的 "<br/>&nbsp;&nbsp; (itoa y)<br/>&nbsp;&nbsp; " 个"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; F<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp; STRLST<br/>&nbsp;&nbsp; newlst<br/>&nbsp; )<br/>&nbsp; (close f)<br/>;;;&nbsp; (princ "\n已写入到临时文件 c:\\temp.txt")<br/>&nbsp; (startapp "notepad" "c:/temp.txt")<br/>&nbsp; (princ)<br/>)<br/></p>

mark199 发表于 2010-10-9 11:09:00

<p>顶一下。</p>

oo191522416 发表于 2011-10-13 00:59:24

好呵!我也看看!

午后的猫 发表于 2012-2-9 20:38:24

很需要这方面的程序

VigorCao 发表于 2012-9-16 16:58:30

感谢楼主啊。。。

xiaguohe 发表于 2012-11-13 09:16:13

谢谢大大,非常需要这方面的程序~~~

cocoorange 发表于 2024-1-14 23:19:38

caiqs 发表于 2009-2-11 12:55
;;;师兄 QQ 361865648(defun c:test ()&nbsp; (setq&nbsp;searchstr (getstring&nbsp;&nbsp;&nbsp;&nbsp;&n ...

CAD中加载输入字符串之后提示错误
“错误: 参数类型错误: symbolp 46”
请问是怎么回事呢?
页: 1 [2]
查看完整版本: 关于CAD图中文字统计程序!