- ;;动态调整标注字高
- (defun c:tt (/ ss n l gr loop)
- (while (setq ss (ssget '((0 . "DIMENSION"))))
- (setq l nil)
- (repeat (setq n (sslength ss))
- (setq l (cons (vlax-ename->vla-object (ssname ss (setq n (1- n)))) l))
- )
- (setq loop t)
- (princ "\n** 按键 \"+\" 增大字高 \"-\" 减小字高 回车间、鼠标左键结束")
- (while loop
- (setq gr (grread t 15))
- (cond
- ((= 3 (car gr))
- (setq loop nil)
- )
- ((= 2 (car gr))
- (cond
- ((or (= 13 (cadr gr)) (= 32 (cadr gr)))
- (setq loop nil)
- )
- ((= 43 (cadr gr)) ;_ +
- (mapcar
- '(lambda (o)
- (vla-put-TextHeight o (* 1.1 (vla-get-TextHeight o)))
- )
- l
- )
- )
- ((= 45 (cadr gr)) ;_ -
- (mapcar
- '(lambda (o)
- (vla-put-TextHeight o (* 0.9 (vla-get-TextHeight o)))
- )
- l
- )
- )
- )
- )
- )
- )
- )
- (princ)
- )
|