[Search tip detail and code files using keywords, tip number, author name, etc ]
 
Quickly Resize Text
Tip# 3228 By Leonid Nemirovsky On 05-Jul-2009
4
Rated By 1 users
Categories : Edit Text
Software type : AutoCAD 2010
Rename File To : No Files to download.
This routine scales text according to your current DIMSCALE settings.

Frequent tipster Len Nemirovsky sent us a routine he wrote to simply change AutoCAD text to the proper scale. "This small routine, TXS, scales text according to your current DIMSCALE settings, very similarly to how standard AutoCAD functions for updating dimensions. Note that if you use windows or crossing selection in this routine, it works in a similar way to selecting DIMENSIONS when you want to update them. In other words, only text objects will be selected regardless of the selection method. Keep in mind, though, if you select blocks, all text objects (including attributes) will be selected also. You can select text and set it to the size you want it to be in paper space."
     (defun c:txs ()
     (setq txth (getreal " Select text hight as desired in PSPACE <0.125>: "))
     (if (= txth nil)(setq txth 0.125))
     (setq scl (getvar "dimscale"))
     (setq obj (ssget text,mtext))
     (if (= obj nil)(exit))
     (command "scaletext" OBJ "" "E" (* txth scl))
     (princ)
     )

Notes from Cadalyst Tip Patrol: To use this routine, load it into AutoCAD and type TXS on the Command line. The routine will ask you for the text height you want it to be on paper. It will scale the text according to the current DIMSCALE and your chosen text height. It works in model or paper space, but will scale the objects according to the current DIMSCALE setting.

 

Average Rating:
4


User comments
Comment by acosta,antonio
Posted on 2009-07-06 20:24:08
nice... i use a similar lisp to change text hight of multipe texts or mtext... (defun c:txtht () ; Selection Set (Filtered List)... (princ " Select all texts to change :") (princ " ") (setq s_set (ssget '( (-4 . "<OR") (0 . "TEXT") (0 . "MTEXT") (-4 . "OR>") ))) ;(setq s_set (ssget '((0 . "TEXT")))) (setq new_heigth (getreal " Enter new hight = ")) ; Entity DXF List Informattion (setq index_1 0) (while (< index_1 (sslength s_set)) (setq e1_list (entget (ssname s_set index_1))) (setq position (cdr (assoc 10 e1_list))) (setq heigth (cdr (assoc 40 e1_list))) (setq e1_list (subst (cons 40 new_heigth) (assoc 40 e1_list) e1_list )) (entmod e1_list) (setq index_1 (+ index_1 1)) ) (command "redraw") )
Comment by acosta,antonio
Posted on 2009-07-06 20:26:01
nice....i use a similiar lisp program to change text hight: (defun c:txtht () ; Selection Set (Filtered List)... (princ " Select texts to change :") (princ " ") (setq s_set (ssget '( (-4 . "<OR") (0 . "TEXT") (0 . "MTEXT") (-4 . "OR>") ))) ;(setq s_set (ssget '((0 . "TEXT")))) (setq new_heigth (getreal " New hight = ")) ; Entity DXF List Information & Manipulation... (setq index_1 0) (while (< index_1 (sslength s_set)) (setq e1_list (entget (ssname s_set index_1))) (setq position (cdr (assoc 10 e1_list))) (setq heigth (cdr (assoc 40 e1_list))) (setq e1_list (subst (cons 40 new_heigth) (assoc 40 e1_list) e1_list )) (entmod e1_list) (setq index_1 (+ index_1 1)) ) (command "redraw") )
Comment by Williams,Stephen
Posted on 2009-07-07 11:45:37
I use the scaletext express tool. I'm not understanding how this is better, considering... by using scaletext I can specify a basepoint to scale it from, scale to a new model height, paper height (for annotative text), match another object, etc... See the autocad users documentation here: http://preview.tinyurl.com/meajvy


Log In