TEXTSIZE控制字高- (defun c:cir8 (/ txth ss ans pt_list i ename ptms fun pt)
- (vl-load-com)
- (setvar "cmdecho" 0)
- (setvar "blipmode" 0)
- (setq txth (getvar "textsize"))
- (setq ss (ssget '((0 . "CIRCLE"))))
- (initget "1 2 3 4 5 6 7 8")
- (setq ans (getkword "\n输入排序方向<1-8>:"))
- (setq pt_list '())
- (setq i 0)
- (repeat (sslength ss)
- (setq ename (ssname ss i))
- (setq ptms (cdr (assoc 10 (entget ename))))
- (setq pt_list (cons ptms pt_list))
- (setq i (+ i 1))
- )
- (cond
- ((= ans "1") (setq fun '(car cadr < <)))
- ((= ans "4") (setq fun '(car cadr > <)))
- ((= ans "8") (setq fun '(car cadr < >)))
- ((= ans "5") (setq fun '(car cadr > >)))
- ((= ans "2") (setq fun '(cadr car < <)))
- ((= ans "7") (setq fun '(cadr car > <)))
- ((= ans "3") (setq fun '(cadr car < >)))
- ((= ans "6") (setq fun '(cadr car > >)))
- )
- (setq pt_list (vl-sort pt_list
- '(lambda (e1 e2)
- ((eval (nth 2 fun))
- ((eval (nth 0 fun)) e1)
- ((eval (nth 0 fun)) e2)
- )
- )
- )
- )
- (setq pt_list (vl-sort pt_list
- '(lambda (e1 e2)
- ((eval (nth 3 fun))
- ((eval (nth 1 fun)) e1)
- ((eval (nth 1 fun)) e2)
- )
- )
- )
- )
- (setq i 0)
- (repeat (sslength ss)
- (setq pt (nth i pt_list))
- (command "text" "m" pt txth 0 (rtos (+ i 1)))
- (setq i (+ i 1))
- )
- (prin1)
- )
|