明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 8140|回复: 20

各位高手,如何统计文字的个数并生成表格,呀,

  [复制链接]
发表于 2012-8-2 17:24 | 显示全部楼层 |阅读模式
各位高手,如何统计文字的个数并生成表格,呀,像图1一样,那么多,我想统计一下生成像图2一样表格,那位有什么好的LSP不或高招不

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2022-5-29 11:47 | 显示全部楼层
xujinhua 发表于 2012-8-8 22:46
(defun c:txt ()
  (setq lst nil  newlst nil x1 0)
(setq a (ssget))

高手(defun c:txt ()
  (setq lst nil  newlst nil x1 0)
(setq a (ssget))
发表于 2021-11-15 11:18 | 显示全部楼层
xujinhua 发表于 2012-8-8 22:46
(defun c:txt ()
  (setq lst nil  newlst nil x1 0)
(setq a (ssget))

您好
請教一下,這個咝衅饋磲幔挥谐霈F「種類」和「數量」
數字都沒有顯現出來
发表于 2019-12-17 15:10 | 显示全部楼层
xujinhua 发表于 2012-8-8 22:46
(defun c:txt ()
  (setq lst nil  newlst nil x1 0)
(setq a (ssget))

不错,就是前面有一个空格和两个空格就认为成两个类别了
发表于 2012-8-3 13:02 | 显示全部楼层
本帖最后由 ㄘ丶转裑ㄧ灬 于 2014-11-15 21:27 编辑

百度:文字计数1.5.dvb
或者..http://pan.baidu.com/share/link?shareid=880667498&uk=4061147393


另:此插件用于32位系统时操作顺畅,
      但用于64位操作系统并保存低版本后,保存图纸会卡半天,建议选用豪沃克3.0(64位)。
http://www.hwksoft.com/soft/%E8%B1%AA%E6%B2%83%E5%85%8B%E5%B9%95%E5%A2%99%E5%B7%A5%E5%85%B7%E5%8C%85X64.exe

2014.11.15更新,以前链接都失效了。。


动画演示:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2012-8-3 14:20 | 显示全部楼层
本帖最后由 xujinhua 于 2012-8-3 14:21 编辑

将文字内容按  (内容 1) 加入表内,然后再将内容相同的合并相加,得到最终的表,然后排列.....
内业太多了,没空搞...
 楼主| 发表于 2012-8-3 22:55 | 显示全部楼层
都下载不了,
发表于 2012-8-8 22:46 | 显示全部楼层
本帖最后由 xujinhua 于 2012-8-8 22:47 编辑

(defun c:txt ()
  (setq lst nil  newlst nil x1 0)
(setq a (ssget))
(setq n (sslength a))
(setq index 0)
(repeat n
(setq el (entget ( ssname a index)))
(setq index ( + index 1))
(setq e (assoc 0 el))
(if (= "TEXT" (cdr e))
(progn
(setq txt (cdr (assoc 1 el)))
(setq lst(cons(append  (list 1) (list txt))lst))
)
)
)
  (while lst
  (setq n 0)
  (foreach i lst(if (= (cadar lst) (cadr i))(setq n (+ n (car i)))))
  (setq newlst (append newlst (list (list n (cadar lst)))))
  (setq lst(vl-remove-if '(lambda (x) (= (cadar lst) (cadr x))) lst))
)
  (setq x2 (getpoint "\起始位置"))
  (setq x3 (polar x2  0 12))
    (command "text" "j" "c" (polar x2 (* pi 0.5) 3) "2" "0" "种类" "")
  (command "text" "j" "c" (polar x3 (* pi 0.5) 3) "2" "0" "数量" "")
  (repeat (length newlst)
    (command "text" "j" "c" x2 "1.5" "0" (nth 1 (nth x1 newlst)) "")
    (command "text"  "j" "c" x3 "1.5" "0" (nth 0 (nth x1 newlst)) "")
    (setq x2(polar x2 (* pi 1.5) 3))
    (setq x3 (polar x2  0 12))
    (setq x1(1+ x1))
    )
  
)


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x

点评

是只对单行文字有效吧  发表于 2015-4-28 15:11
发表于 2012-9-16 17:16 | 显示全部楼层
xujinhua 发表于 2012-8-8 22:46
(defun c:txt ()
  (setq lst nil  newlst nil x1 0)
(setq a (ssget))

高手厉害啊
发表于 2012-12-8 16:55 | 显示全部楼层
运行起来只有种类和数量,不见数字,啥情况?
 楼主| 发表于 2012-12-10 12:26 | 显示全部楼层
高手呀,服了
发表于 2013-5-1 22:23 | 显示全部楼层
高手,能改改只统计所需要的文字的数量就好
发表于 2013-5-27 15:04 | 显示全部楼层
运行起来只有种类和数量,不见数字,啥情况?

点评

应该是只对单行文字有效  发表于 2015-4-28 15:11
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-2 22:16 , Processed in 1.286969 second(s), 34 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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