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/> (setq searchstr (getstring<br/> "\n请输入要查找的字符,以短号隔开,可以使用通匹符: "<br/> )<br/> )<br/> (SETQ STRLST<br/> (READ<br/> (STRCAT<br/> "("<br/> (VL-LIST->STRING (subst 32 44 (VL-STRING->list searchstr)))<br/> ")"<br/> )<br/> )<br/> )<br/> (setq strlst(mapcar 'VL-SYMBOL-name strlst))<br/> (SETQ N 0<br/> NEWLST NIL<br/> )<br/> (REPEAT (LENGTH STRLST)<br/> (SETQ SS NIL<br/> J 0<br/> )<br/> (setq searchstr (nth n strlst))<br/> (SETQ SS (SSGET "X"<br/> (LIST (CONS 0 "*TEXT")<br/> (cons -4 "<or")<br/> (CONS 1 (strcase searchstr))<br/> (cons 1 (strcase searchstr t))<br/> (cons -4 "or>")<br/> )<br/> )<br/> )</p><p><br/> (SETQ N (1+ N))<br/> (IF SS<br/> (SETQ J (SSLENGTH SS))<br/> (SETQ J 0)<br/> )</p><p> (SETQ NEWLST (CONS J NEWLST))<br/> )<br/> (SETQ NEWLST (REVERSE NEWLST))<br/> (setq f (open "c:/temp.txt" "w"))<br/> (mapcar '(lambda (x y)<br/> (WRITE-LINE</p><p> (STRCAT<br/> x<br/> " 开头的 "<br/> (itoa y)<br/> " 个"<br/> )<br/> F<br/> )<br/> )<br/> STRLST<br/> newlst<br/> )<br/> (close f)<br/>;;; (princ "\n已写入到临时文件 c:\\temp.txt")<br/> (startapp "notepad" "c:/temp.txt")<br/> (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/> (setq searchstr (getstring<br/> "\n请输入要查找的字符,以短号隔开,可以使用通匹符: "<br/> )<br/> )<br/> (SETQ STRLST<br/> (READ<br/> (STRCAT<br/> "("<br/> (VL-LIST->STRING (subst 32 44 (VL-STRING->list searchstr)))<br/> ")"<br/> )<br/> )<br/> )<br/> (setq strlst(mapcar 'VL-SYMBOL-name strlst))<br/> (SETQ N 0<br/> NEWLST NIL<br/> )<br/> (REPEAT (LENGTH STRLST)<br/> (SETQ SS NIL<br/> J 0<br/> )<br/> (setq searchstr (nth n strlst))<br/> (SETQ SS (SSGET "X"<br/> (LIST (CONS 0 "*TEXT")<br/> (cons -4 "<or")<br/> (CONS 1 (strcase searchstr))<br/> (cons 1 (strcase searchstr t))<br/> (cons -4 "or>")<br/> )<br/> )<br/> )</p><p><br/> (SETQ N (1+ N))<br/> (IF SS<br/> (SETQ J (SSLENGTH SS))<br/> (SETQ J 0)<br/> )</p><p> (SETQ NEWLST (CONS J NEWLST))<br/> )<br/> (SETQ NEWLST (REVERSE NEWLST))<br/> (setq f (open "c:/temp.txt" "w"))<br/> (mapcar '(lambda (x y)<br/> (WRITE-LINE</p><p> (STRCAT<br/> x<br/> " 开头的 "<br/> (itoa y)<br/> " 个"<br/> )<br/> F<br/> )<br/> )<br/> STRLST<br/> newlst<br/> )<br/> (close f)<br/>;;; (princ "\n已写入到临时文件 c:\\temp.txt")<br/> (startapp "notepad" "c:/temp.txt")<br/> (princ)<br/>)<br/></p><p> </p>caiqs 发表于 2009-2-11 12:55:00
<p><br/>;;;师兄 QQ 361865648<br/>(defun c:test ()<br/> (setq searchstr (getstring<br/> "\n请输入要查找的字符,以短号隔开,可以使用通匹符: "<br/> )<br/> )<br/> (SETQ STRLST<br/> (READ<br/> (STRCAT<br/> "("<br/> (VL-LIST->STRING (subst 32 44 (VL-STRING->list searchstr)))<br/> ")"<br/> )<br/> )<br/> )<br/> (setq strlst(mapcar 'VL-SYMBOL-name strlst))<br/> (SETQ N 0<br/> NEWLST NIL<br/> )<br/> (REPEAT (LENGTH STRLST)<br/> (SETQ SS NIL<br/> J 0<br/> )<br/> (setq searchstr (nth n strlst))<br/> (SETQ SS (SSGET "X"<br/> (LIST (CONS 0 "*TEXT")<br/> (cons -4 "<or")<br/> (CONS 1 (strcase searchstr))<br/> (cons 1 (strcase searchstr t))<br/> (cons -4 "or>")<br/> )<br/> )<br/> )</p><p><br/> (SETQ N (1+ N))<br/> (IF SS<br/> (SETQ J (SSLENGTH SS))<br/> (SETQ J 0)<br/> )</p><p> (SETQ NEWLST (CONS J NEWLST))<br/> )<br/> (SETQ NEWLST (REVERSE NEWLST))<br/> (setq f (open "c:/temp.txt" "w"))<br/> (mapcar '(lambda (x y)<br/> (WRITE-LINE</p><p> (STRCAT<br/> x<br/> " 开头的 "<br/> (itoa y)<br/> " 个"<br/> )<br/> F<br/> )<br/> )<br/> STRLST<br/> newlst<br/> )<br/> (close f)<br/>;;; (princ "\n已写入到临时文件 c:\\temp.txt")<br/> (startapp "notepad" "c:/temp.txt")<br/> (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 () (setq searchstr (getstring &n ...
CAD中加载输入字符串之后提示错误
“错误: 参数类型错误: symbolp 46”
请问是怎么回事呢?
页:
1
[2]