正文

通过鼠标操作统计块的数量2006-05-15 10:27:00

【评论】 【打印】 【字体: 】 本文链接:http://blog.pfan.cn/otot/14092.html

分享到:

(defun c:nn(/ p1 name1 objs ent a ss no)   (setq p1 (getpoint "请点选将统计的块:"))  (setq name1 (ssname (ssget p1) 0))  (setq ent (entget name1))  ;;(princ ent)  (setq a   (cdr (assoc 2 ent)))    ;将目标的块名字提取出来  (princ "\n框住需要统计的范围:")  (setq ss (ssget (list(cons 0 "INSERT")(cons 2 a))))  ;框选范围内的同名字块              (if (= ss nil)       ;;      (setq no 0)       (setq no (sslength ss))  )         ;;  (princ "\n  图块《")   (princ a)(princ "》数量为:  ")   (princ no)(princ "  只")(princ))(princ "\n\t 统计图块命令,设计者:刘珽锋 欢迎使用!")(princ "\n\t 请输入命令:NN ")(princ)

阅读(3497) | 评论(0)


版权声明:编程爱好者网站为此博客服务提供商,如本文牵涉到版权问题,编程爱好者网站不承担相关责任,如有版权问题请直接与本文作者联系解决。谢谢!

评论

暂无评论
您需要登录后才能评论,请 登录 或者 注册