下面的程序放到:ACA.LSP文件中,执行命令:BL,按提示Scale factor:输入值,即可改变全部文字的字高
, i! Z' i- X* B! u; i注意:标题块、图框最好作成图块,不然它们中的字字高也变了!!!!!!!!! j3 F3 E, h* Y9 |
1 V& s4 D* f. h( I. Q4 ?(defun c:bl()7 p0 E/ W5 [9 h ^" o: J
(setq val (getreal "Scale factor: "))
; S2 O, l4 o3 X5 M3 |;;默认文字字高4.0mm) s4 r' _* ?3 a5 o+ k. F
(setq high (* 4 val))* v" B7 ?0 c7 r4 G
(setq ssl (ssget "X" (list (cons 0 "MTEXT"))))
% f, w9 x! {- e6 z/ S7 a% d(setq N (- (sslength ssl) 1))* t- h* b# L9 c; U
(setq test 0)+ T+ o1 A: I# u: n' o3 G
(while (<= test N )/ Q3 s; Z! d+ `& I: E( P$ h
(setq DIMENSION (ENTGET (ssname ssl test))); a3 S; u1 L. o& b: v
(setq DIMENSION (subst (cons 40 high) (assoc 40 DIMENSION) DIMENSION ))* Y) w! e4 O% a, O/ k1 Z+ M! }. j
(entmod DIMENSION)6 G! d$ k& q, q# w4 n
(setq test (+ 1 test))
9 \# g3 B+ c+ g1 Z. b! e) v+ Z1 v; W$ W1 w
(setq ssl (ssget "X" (list (cons 0 "TEXT"))))
4 A! s, Y4 t4 m! [! ~2 C; I+ a' M(setq N (- (sslength ssl) 1))
( } I( E+ \( A+ W; p(setq test 0)9 L, K7 q; ~# |7 |
(while (<= test N )8 f- P( O# U9 l# \0 c; @
(setq DIMENSION (ENTGET (ssname ssl test)))1 y+ ?# N7 j7 T, G1 l0 j' ]2 d
(setq DIMENSION (subst (cons 40 high) (assoc 40 DIMENSION) DIMENSION ))
# h7 g% O5 f- |8 S) C4 z+ S(entmod DIMENSION)
# M3 F) O2 }, T6 N! ?5 q% @$ ~(setq test (+ 1 test))* K5 \& o- }4 [" @* i. o- L' y
)( _7 k( }, J9 J, p% a: I
) |