[post=5]- (defun c:tt ()
- (setq fn (if (= (type fn) 'STR) fn ""))
- (setq fn (getfiled "输出文件名" fn "txt" 4))
- (if (setq ss (ssget '((0 . "CIRCLE") (40 . 5.0)))) (progn
- (setq i -1)
- (setq fp (open fn "w"))
- (repeat (sslength ss)
- (setq pc (cdr(assoc 10 (entget(ssname ss (setq i (1+ 1))))))
- p1 (mapcar '+ pc (list 5 5))
- p2 (mapcar '- pc (list 5 5)))
- (if (= (sslength(setq ss1 (ssget "C" p1 p2 '((0 . "TEXT"))))) 2) (progn
- (setq ent1 (entget(ssname ss1 0)) ent2 (entget(ssname ss1 1))
- pt1 (cdr(assoc 10 ent1)) pt2 (cdr(assoc 10 ent2)))
- (if (> (cadr pt1) (cadr pt2))
- (princ (strcat(cdr(assoc1 1 ent1)) (cdr(assoc 1 ent2))) fp)
- (princ (strcat(cdr(assoc1 1 ent2)) (cdr(assoc 1 ent1))) fp)
- )
- ))
- )
- (close fp)
- ))
- (princ)
- )
[/post |