下面的程序放到:ACA.LSP文件中,执行命令:BL,按提示Scale factor:输入值,即可改变全部文字的字高
* \$ [' L7 N# v y注意:标题块、图框最好作成图块,不然它们中的字字高也变了!!!!!!!!1 V( S, F( c) |2 S% V6 s$ j5 ^# h& \3 Z
, \9 E4 y9 C [( y6 i
(defun c:bl()
/ ^8 k+ u! v9 V. s/ e! q(setq val (getreal "Scale factor: "))
- u- X4 y# q2 e* }: Y, W;;默认文字字高4.0mm
. j( [" a" `5 P( y(setq high (* 4 val))
: p6 c1 j' `6 _6 ?/ r- a' q(setq ssl (ssget "X" (list (cons 0 "MTEXT"))))
, ]+ @. S9 c ] E) e W' g9 G3 `(setq N (- (sslength ssl) 1))! Z& Z9 U0 v% \$ p+ K5 H, @
(setq test 0)
! ]. c9 r8 `3 O7 I$ {(while (<= test N )
& K2 z+ \1 k5 y) A, E7 R4 D6 w e(setq DIMENSION (ENTGET (ssname ssl test))): j5 z* q5 _6 _/ i0 Z/ n& M: o
(setq DIMENSION (subst (cons 40 high) (assoc 40 DIMENSION) DIMENSION ))1 n+ i N$ w# ~
(entmod DIMENSION)
( |# E/ G- Y, \. B% m* k/ X9 ^(setq test (+ 1 test))9 E; y0 h) p3 N3 L/ A7 A
)6 [5 p( o2 T/ i+ S& U5 S5 r
(setq ssl (ssget "X" (list (cons 0 "TEXT"))))* T4 S( E$ ]0 z: S
(setq N (- (sslength ssl) 1)); F" v, Y' o2 K# P# z* L0 w
(setq test 0)
9 @ b- w* L1 Y& N: U8 q* Y% j(while (<= test N ) \, K- w4 O6 d1 N% E) T
(setq DIMENSION (ENTGET (ssname ssl test)))) x" o; O$ U) O/ x
(setq DIMENSION (subst (cons 40 high) (assoc 40 DIMENSION) DIMENSION )) C% ?3 C7 A- S
(entmod DIMENSION)
! Q+ }9 x: B" _# W& f(setq test (+ 1 test))
/ t! Q5 }: w1 T)
2 V7 ^: ], y% l$ g3 {6 y& U7 B) |