几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(AutoLISP) (http://www.dimcax.com/hust/forumdisplay.php?f=178)
-   -   关于cad图中文字统计程序! (http://www.dimcax.com/hust/showthread.php?t=11598)

yang686526 2009-04-26 05:06 PM

关于cad图中文字统计程序!
 
关于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


所有的时间均为北京时间。 现在的时间是 12:10 AM.