关于cad图中文字统计程序!
www.dimcax.com
caoyin斑竹在不,麻烦你了!
d
;;;师兄
(strcat
"("
(vl-list->string (subst 32 44 (vl-string->list searchstr)))
")"
)
)
)
(setq strlst(mapcar 'vl-symbol-name strlst))
(setq n 0
newlst nil
)
(repeat (length strlst)
(setq ss nil
j 0
)
(setq searchstr (nth n strlst))
(setq ss (ssget "x"
(list (cons 0 "*text")
(cons -4 "<or")
(cons 1 (strcase searchstr))
(cons 1 (strcase searchstr t))
(cons -4 "or>")
)
)
)
(setq n (1+ n))
(if ss
(setq j (sslength ss))
(setq j 0)
)
(setq newlst (cons j newlst))
)
(setq newlst (reverse newlst))
(setq f (open "c:/temp.txt" "w"))
(mapcar '(lambda (x y)
(write-line
(strcat
x
" 开头的 "
(itoa y)
" 个"
)
f
)
)
strlst
newlst
)
(close f)
;;; (princ "\n已写入到临时文件 c:\\temp.txt")
(startapp "notepad" "c:/temp.txt")
(princ)
)
d
;;;命令测试
;;;命令:
;;;命令: test
;;;请输入要查找的字符,以短号隔开,可以使用通匹符: *str,545*
;;;命令:
;;;师兄
(strcat
"("
(vl-list->string (subst 32 44 (vl-string->list searchstr)))
")"
)
)
)
(setq strlst(mapcar 'vl-symbol-name strlst))
(setq n 0
newlst nil
)
(repeat (length strlst)
(setq ss nil
j 0
)
(setq searchstr (nth n strlst))
(setq ss (ssget "x"
(list (cons 0 "*text")
(cons -4 "<or")
(cons 1 (strcase searchstr))
(cons 1 (strcase searchstr t))
(cons -4 "or>")
)
)
)
(setq n (1+ n))
(if ss
(setq j (sslength ss))
(setq j 0)
)
(setq newlst (cons j newlst))
)
(setq newlst (reverse newlst))
(setq f (open "c:/temp.txt" "w"))
(mapcar '(lambda (x y)
(write-line
(strcat
x
" 开头的 "
(itoa y)
" 个"
)
f
)
)
strlst
newlst
)
(close f)
;;; (princ "\n已写入到临时文件 c:\\temp.txt")
(startapp "notepad" "c:/temp.txt")
(princ)
)
d
;;;师兄
(strcat
"("
(vl-list->string (subst 32 44 (vl-string->list searchstr)))
")"
)
)
)
(setq strlst(mapcar 'vl-symbol-name strlst))
(setq n 0
newlst nil
)
(repeat (length strlst)
(setq ss nil
j 0
)
(setq searchstr (nth n strlst))
(setq ss (ssget "x"
(list (cons 0 "*text")
(cons -4 "<or")
(cons 1 (strcase searchstr))
(cons 1 (strcase searchstr t))
(cons -4 "or>")
)
)
)
(setq n (1+ n))
(if ss
(setq j (sslength ss))
(setq j 0)
)
(setq newlst (cons j newlst))
)
(setq newlst (reverse newlst))
(setq f (open "c:/temp.txt" "w"))
(mapcar '(lambda (x y)
(write-line
(strcat
x
" 开头的 "
(itoa y)
" 个"
)
f
)
)
strlst
newlst
)
(close f)
;;; (princ "\n已写入到临时文件 c:\\temp.txt")
(startapp "notepad" "c:/temp.txt")
(princ)
)
d