写了个圆心距的程序,最小距离可求出了,但判断不出是哪两个间距最小,或人为定最小距离,将小于该距离的圆标示出来。请高手加最小间距圆变色,谢谢- ;;;最小圆心距,by x_s_s_1@163.com
- (defun c:zxjj ( / ss n i en_list center_circle_list dist_list min_dist)
- (setq ss (ssget '((0 . "circle"))))
- (setq n (sslength ss))
- (setq i 0)
- (setq en_list nil)
- (while (< i n)
- (setq en_list (cons (ssname ss i) en_list))
- (setq i (1+ i))
- ) ;_ 结束while
- (setq center_circle_list
- (mapcar
- '(lambda (en) (cdr (assoc 10 (entget en))))
- en_list
- ) ;_ 结束mapcar
- ) ;_ 结束setq
- (setq dist_list nil)
- (while (< 1 (length center_circle_list))
- (setq dist_list
- (append
- (mapcar
- '(lambda (x) (distance (car center_circle_list) x))
- (cdr center_circle_list)
- ) ;_ 结束mapcar
- dist_list
- ) ;_ 结束append
- ) ;_ 结束setq
- (setq center_circle_list (cdr center_circle_list))
- ) ;_ 结束while
- (princ (setq min_dist (apply 'min dist_list)))
- ) ;_ 结束defun
|