lhyvn 发表于 2019-6-13 17:11:56

太好了,大侠啊

hn10183051 发表于 2019-8-19 13:45:45

改为插入CAD这么写

hn10183051 发表于 2019-8-31 15:58:16

怎么以表格方式统计?大师们

500w008 发表于 2019-9-5 02:12:13

hn10183051 发表于 2019-9-5 11:56:43

应该好了~~~

2496653555 发表于 2020-11-28 14:43:11

;;
(defun c:YGS (/ AS D DD DNS FS GET GV K KS LEN NN S ST)
(princ "\n功能 [统计圆直径数量弹窗]")
(setq gv (getvar "dimzin"))
(setvar 'dimzin 8)
(if (setq get (ssget '((0 . "CIRCLE"))))
    (progn
      (setq Len (sslength get) k 1)
      (repeat Len
(setq nn (ssname get (setq Len (1- Len)))
      as (cdr (assoc 40 (entget nn)))
as (atof (rtos as 2 2))
)
(if (null (setq dd (assoc as Dns)))
    (setq Dns (cons (list as k) Dns))
    (setq Dns (subst (list as (1+ (cadr dd))) (assoc as Dns) Dns))
)      
      )
      (foreach x Dns
(setq d   (car x)
      s   (cadr x)
      st (strcat "直径"
       (rtos (* d 2) 2 2)
       ",数量"
       (rtos s 2 2)
       "\n"
   )
      ks (cons (list st) ks)
)
      )
      (setq fs (apply 'strcat (mapcar 'car ks)))
      ;(alert fs)
(setq po (getpoint "input point----:"))
(command "text" po "2" "" FS"")
;(setq wz1 (entlast))
;(command "DDEDIT" wz1 "" "")
    )
)
(setvar 'dimzin gv)
(princ)
);

天宇飞翔12 发表于 2020-11-29 12:28:46

能不能扩展到多段线的圆

xyp1964 发表于 2020-11-30 18:04:16

本帖最后由 xyp1964 于 2020-11-30 18:09 编辑



;; tt(框选统计圆数量)
(defun c:tt () (if (and (setq ss (ssget '((0 . "CIRCLE")))i-1)
         (setq p0 (getpoint "\n基点<退出>: "))
      )
    (setq lst (xyp-Ss2List ss)
          lst (mapcar '(lambda (x) (xyp-DXF 40 x)) lst)
          lst (xyp-List-Count lst)
          aa(xyp-TableAuto p0 lst '("序号" "圆半径" "数量"))
    )
)
(princ)
)








天宇飞翔12 发表于 2020-12-2 08:20:52

能不能扩展到更改为多段线的圆

迷失1786 发表于 2023-7-1 20:57:50

琴剑江山_10184 发表于 2015-6-2 17:17


大哥,不要弹窗,写进CAD里面要怎么改?
页: 1 [2] 3
查看完整版本: 框选统计圆数量程序改善