When combining drawings from different consultants or assembling project sheets from multiple sources, inconsistent text sizes are a common issue. Fixing text heights manually using the Properties panel (CHPROP) or the MATCHPROP command forces you to click through objects one by one—a slow and tedious process when working with dozens of labels across a plan.
The TSZ.lsp (Text Size Adjustment) routine allows you to batch update text heights across any selection box in seconds. It remembers your previously applied text height for continuous use, filters out non-text geometry automatically, and includes a quick Reset keyword to change target dimensions mid-session.
Key Workflow Highlights
Automatic Entity Filtering: Drag a broad crossing box over your entire drawing area. The script automatically filters the selection to modify only
TEXTandMTEXTobjects while leaving lines, blocks, and dimensions untouched.Persistent Size Memory: Stores your last entered text height in a global variable. On subsequent uses, simply hit Enter to reapply the same height without retyping the value.
Quick Value Reset: Need to switch to a different label scale? Type
Reset(orR) at the command prompt to define a new base height instantly.
How to Execute the Script
Load
TSZ.lspinto AutoCAD using theAPPLOADcommand.Type
TSZin the command line and hit Enter.Set your text height:
Enter your target numerical height value (e.g.,
2.5or100).On subsequent runs, press Enter to keep your saved height, or type
Resetto enter a new value.
Select the target area on your screen using a window selection box.
Press Enter to confirm. All selected text elements will immediately scale to the target height.
AutoLISP Code (TSZ.lsp)
Copy the code below and save it as TSZ.lsp inside your AutoCAD support folder:
(vl-load-com)
(defun c:TSZ ( / input ss i ent obj old-error old-osnap acDoc )
(setq acDoc (vla-get-ActiveDocument (vlax-get-acad-object)))
(vla-StartUndoMark acDoc)
(setq old-osnap (getvar "OSMODE"))
(setq old-error *error*)
(defun *error* (msg)
(if old-osnap (setvar "OSMODE" old-osnap))
(if acDoc (vla-EndUndoMark acDoc))
(setq *error* old-error)
(princ "\nCAD Lisp [www.daolpro.com]")
(princ)
)
(if (not g_txtsize)
(setq g_txtsize (getreal "\nEnter new text height: "))
(progn
(initget "Reset")
(setq input (getreal (strcat "\nEnter text height or [Reset] <" (rtos g_txtsize 2) ">: ")))
(cond
((= input "Reset")
(setq g_txtsize (getreal "\nEnter new text height: "))
)
((numberp input)
(setq g_txtsize input)
)
)
)
)
(if g_txtsize
(progn
(prompt "\nSelect text objects to change size: ")
(if (setq ss (ssget '((0 . "TEXT,MTEXT"))))
(progn
(setq i 0)
(while (< i (sslength ss))
(setq ent (ssname ss i))
(setq obj (vlax-ename->vla-object ent))
(vla-put-height obj g_txtsize)
(setq i (1+ i))
)
(prompt (strcat "\nSuccessfully changed to size " (rtos g_txtsize 2) "."))
)
(prompt "\nNo text selected.")
)
)
)
(if old-osnap (setvar "OSMODE" old-osnap))
(if acDoc (vla-EndUndoMark acDoc))
(setq *error* old-error)
(princ "\nCAD Lisp [www.daolpro.com]")
(princ)
)
Drafting Standards Tip
When preparing sheets for plotting, maintain standardized text height ratios (e.g., 2.5mm for general notes, 3.5mm for room titles, 5.0mm for drawing numbers) so your printed layouts remain clean and easy to read across all view scales.

Post a Comment