Hi aaronic,
This code not yet test,sorry
Code:
(defun c:thc (/ cnt ct dwgscale ent lp note noteha notehh sstext th tha thi thit tl)
(prompt "\n*text height conversion*")
(prompt "\nchoose text ")
(setq sstext (ssget '((0 . "text"))))
(setq note (sslength sstext))
;(setq ct (- not 1))
(setq cnt 0)
(if
(= thi nil)
(progn
(setq dwgscale (getreal "\nEnter drawing scale <1/2>: "))
(if (= dwgscale nil)(setq dwgscale 0.5))
(setq thi (* dwgscale 0.1))
) ; progn
) ; if
;(prompt "\nnew text height<")
;(prompt (rtos thi))
;(prompt ">: ")
(prompt (strcat "\nnew text height< " (rtos thi) " >: "))
(setq thit (getdist))
(if (/= thit nil) (setq thi thit))
(terpri)
;(princ ct)
(prompt " text entities, converting... ")
(setq lp 1)
;(while lp
(repeat
note
(setq ent (ssname sstext ct))
(setq tl (entget ent))
(setq th (assoc 40 tl))
(setq tha (cons 40 thi))
(setq notehh (subst tha th tl))
(entmod noteha)
;(setq ct (- ct 1))
(setq cnt (1+ cnt))
;(if (< ct 0) (setq lp nil))
) ; repeat
(princ)
);end thc
Originally Posted by
aaronic_abacus
; This autolisp program converts text height
(DEFUN C:THC (/ SSTEXT NOT CT LP ENT)
(PROMPT "\n*TEXT HEIGHT CONVERSION*")
(PROMPT "\nChoose text ")
(SETQ SSTEXT (SSGET '((0 . "TEXT"))))
(SETQ NOT (SSLENGTH SSTEXT))
(SETQ CT (- NOT 1))
(IF (= THI NIL) (SETQ THI (* DWGSCALE 0.1)))
(PROMPT "\nNew text height<")
(PROMPT (RTOS THI))
(PROMPT ">: ")
(SETQ THIT (GETDIST))
(IF (/= THIT NIL) (SETQ THI THIT))
(TERPRI)
(PRINC CT)
(PROMPT " Text Entities, Converting... ")
(SETQ LP 1)
(WHILE LP
(SETQ ENT (SSNAME SSTEXT CT))
(SETQ TL (ENTGET ENT))
(SETQ TH (ASSOC 40 TL))
(SETQ THA (CONS 40 THI))
(SETQ NTH (SUBST THA TH TL))
(ENTMOD NTH)
(SETQ CT (- CT 1))
(IF (< CT 0) (SETQ LP NIL))
);END WHILE
(PRINC)
);END THC