- ;圆分类标注 明经ZZXXQQ 2009.6
- (defun c:tt ()
- (setvar "CMDECHO" 0)
- (setq oldos (getvar "OSMODE"))
- (setvar "OSMODE" 0)
- (if (and (princ "\n【提示】选择圆对象....") (setq ss1 (ssget '((0 . "CIRCLE"))))) (progn
- (setq i 0 j 65 cl (list))
- (repeat (sslength SS1)
- (setq ent (entget(ssname ss1 i)))
- (setq pc (cdr(assoc 10 ent)))
- (setq r (cdr(assoc 40 ent)))
- (if (setq rl (assoc r cl))
- (setq cl (subst (list r (cons (caadr rl) (1+ (cdadr rl)))) rl cl))
- (setq cl (cons (list r (cons (chr j) 1)) cl) j (1+ j))
- )
- (setq i (1+ i))
- )
- (setq i 0 j 0 cl (reverse cl))
- (repeat (sslength ss1)
- (setq ent (entget(ssname ss1 i)))
- (setq pc (cdr(assoc 10 ent)))
- (setq r (cdr(assoc 40 ent)))
- (if (setq rl (cadr(assoc r cl)))
- (command "TEXT" "MC" pc "" 0.0 (car rl))
- )
- ; (if (and (setq rl (assoc r cl)) (> (cdr r1) 1))
- ; (command "TEXT" "J" "MC" pc "" 0.0 (ascii (+ (cdr rl) 40)))
- ; )
- (setq i (1+ i))
- )
- ))
- (setvar "OSMODE" oldos)
- (setvar "CMDECHO" 1)
- (princ)
- )
|