wzc1985
发表于 2014-10-21 11:18:17
我也需要,十分感谢
啊业_48384
发表于 2014-10-21 13:50:05
如果大小圆孔分出更好
wmz
发表于 2014-10-21 20:10:15
啊业_48384 发表于 2014-10-21 13:50 static/image/common/back.gif
如果大小圆孔分出更好
那就导出圆半径,再按其半径大小排序!
iszc
发表于 2014-10-21 20:15:05
不知能用一条多义线连接所有圆心坐标么,这样导出的坐标好像不是按照上下左右顺序排列的
啊业_48384
发表于 2014-10-23 21:39:07
以这样就更好,老师们改下
D2.00
N1,54.92,-2.62
N2,131.76,-2.62
N3,83.49,-28.74
N4,142.67,-28.74
N5,114.62,-52.02
N6,59.37,-52.02
N7,77.79,-52.02
D3.00
N8,96.20,-52.02
N9,133.03,-52.02
N10,38.16,-55.20
D4.0
N11,123.88,-76.57
N12,34.73,-78.86
啊业_48384
发表于 2014-10-24 21:29:16
以这样就更好,老师们改下
wmz
发表于 2014-10-25 12:28:21
(defun c:tt(/ e e1 e2 f n m p pp p0 pt y x r r0)
(setq f (open "D:/test.txt" "w"))
(setq s (ssget))
(setq n (sslength s) m 0 pp '())
(repeat n
(setq e (ssname s m) m (1+ m))
(setq e1 (entget e))
(setq e2 (cdr(assoc 0 e1)))
(if (= e2 "CIRCLE")
(progn
(setq pt (cdr (assoc 10 e1)))
(setqy (car pt) x (cadr pt))
(setqr (cdr (assoc 40 e1)))
(setq pp (cons (list r y x) pp))
)
)
)
(setq pp (sort_pList pp))
(setq m 0 r0 nil)
(repeat (length pp)
(setq p (nth m pp) m (1+ m))
(setq r (car p))
(setq p0 (strcat "N" (rtos m 2 0) "," (rtos (cadr p) 2 2) "," (rtos (caddr p) 2 2)))
(if (/= r r0)
(progn
(write-line (strcat "D" (rtos r 2 2)) f)
(write-line p0 f)
(setq r0 r)
)
(progn
(write-line p0 f)
)
)
)
(close f)
(princ)
)
;;;对点表按xyz排序
(defun sort_pList (plist / fp pt)
(setq plist (vl-sort plist
'(lambda (p1 p2)
(cond ((< (car p1) (car p2)) T)
((and (= (car p1) (car p2))
(> (caddr p1) (caddr p2))
)
T
)
((and (= (car p1) (car p2))
(= (caddr p1) (caddr p2))
(< (cadr p1) (cadr p2))
)
T
)
(T nil)
)
)
)
)
)
wmz
发表于 2014-10-27 12:55:07
啊业_48384 发表于 2014-10-24 21:29 static/image/common/back.gif
以这样就更好,老师们改下
要的那么厉害,不见人了。
啊业_48384
发表于 2014-10-29 10:43:01
D不是直径吗,是半径的呀。还是谢谢!!!
wmz
发表于 2014-10-29 11:06:12
本帖最后由 wmz 于 2014-10-29 11:11 编辑
啊业_48384 发表于 2014-10-29 10:43 static/image/common/back.gif
D不是直径吗,是半径的呀。还是谢谢!!!
你是要直径还是要半径?
若是要直径,改这一句: (setqr (cdr (assoc 40 e1))) 改为: (setqr (*(cdr (assoc 40 e1))2.0))