• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
blog.draftsperson.net

blog.draftsperson.net

the art of technical drawing

blog.draftsperson.net

CHGTEXT LISP: Match Text Height and Style in AutoCAD

September 18, 2020

Last updated July 28, 2026

CHGTEXT copies the height and style of one piece of text onto others. Pick a piece of text that looks the way you want, select everything that should match it, and both properties are applied across the selection.

It is by Art Whitton, dated 27 November 1996 — the same author as the polyline chainage routine on this site, and written to the same standard: a full variable table in the header and a comment on almost every line.

Pick the source, then the targets

The order matters and the routine enforces it. The first thing it asks for is a source, and it will not accept anything that is not single-line text — pick a line, a block or empty space and it simply asks again. That check is worth having, because picking the wrong thing as a source would otherwise propagate nonsense across your whole selection.

Once it has a source it tells you what it found: “This entity has a height of…” followed by the number, and the style name. That is a confirmation step most routines skip, and it is the moment to notice you picked the wrong piece of text.

Then you select the text to change, and it works through the selection reporting its progress on the command line as it goes.

Height and style, nothing else

Be clear about the scope. It copies two properties: the text height and the text style. It does not touch layer, colour, rotation, justification or width factor, and it does not change the text content.

That narrowness is the point. Standardising heights and styles across annotation that has come from three sources is a real job, and doing it without disturbing anything else is exactly what you want. If you need the style forced to one particular name regardless of what you pick, CHT does that instead.

One thing a reader of the code will notice: the author wrote out a full list of local variables in the function definition and then commented it out, so the routine’s working variables are left in the drawing session rather than being cleaned up. The variable table in the header still documents them all as local, which they were presumably meant to be. It has no effect on the result.

Command reference

The command is CT, not CHGTEXT. The file and the listing are both called chgtext, but two letters is what you type.

Two-letter names are worth checking against your own aliases before loading. Note also that a routine called CHTEXT ships in Autodesk’s Bonus Tools, bundled in the CAD Tools download here — a different routine with a similar name doing a related job, which is a good recipe for confusion if you have both.

How to load it

Unzip Chgtext.zip and load chgtext.lsp with APPLOAD, or put it in the Startup Suite. No support files. Our AutoLISP guide covers loading. The file is also worth reading if you are learning — the header’s variable table is a good model for documenting your own work.

Step-by-step usage

  1. Type CT.
  2. At “Pick a text entity as your source:” click the text that looks right. Anything that is not single-line text is refused.
  3. Read back the height and style it reports. If that is not what you meant, escape and start again.
  4. Select the text to change and press Enter. It counts through them as it works.

Compatibility notes

1996, so written-for rather than tested-on. It works by editing entity data directly rather than driving commands, which is the more durable approach — the text height and style properties it manipulates have not changed.

Plain AutoLISP with no dialog boxes and no Express Tools calls, so nothing requires the full product; LT users on LT 2024 or later, the release that brought AutoLISP to LT, should be able to run it. See what runs on AutoCAD LT. It modifies text, so try it on a copy first.

Download

Name: CHGTEXT
Description: This program will allow the user to select an existing text from the
screen and then select text using a selection set the change this text
to the same height and style of the original source text.
Type: AutoCAD AutoLISP Routine
Author: Art Whitton
File Size: 2 Kb
Cost: Free
Worked on: AutoCAD
Download File: Chgtext.zip

Related routines

  • CHT — forces text to one named style rather than matching a sample.
  • PDIST — the same author’s chainage routine.
  • TEXTSIZE — work out what the height should be in the first place.

References

  • AutoLISP: the complete guide
  • Free LISP routines library
  • AutoLISP Lesson 9: Data Structures
  • AutoLISP on AutoCAD LT

Filed Under: AutoLISP Routines

Primary Sidebar

Subscribe to our Youtube Channel

Post CAD drafting jobs on Freelancer.com. and get some free money to do this.

Categories

  • American Steel Industry (4)
  • AutoCAD Articles & Reference (30)
  • AutoCAD Bugs & Problems (19)
  • AutoCAD Tips (29)
  • AutoCAD Tutorials (54)
  • AutoLISP Routines (328)
  • AutoLISP Tutorials (15)
  • CAD Standards (7)
  • Civil 3D (7)
  • Civil Drafting (4)
  • Dimensions (2)
  • Drafting Funnies (71)
  • Drafting History (9)
  • Drafting Standards (84)
  • Electrical Drafting (2)
  • General IT reference (7)
  • Geometry (15)
  • GIS (2)
  • Hatch Patterns (12)
  • Office Life Hacks (3)
  • PT (1)
  • Revit Tutorials (54)
  • Steel Detailing (14)
  • Structural Drafting (26)
  • Technical Dictionary (61)
  • Useful Website Links (19)

Footer

Free downloads

  • Free AutoLISP routines
  • Free hatch patterns
  • SHX fonts & text styles
  • Numbering LISP collection
  • ISO 3098B font

Reference charts

  • AWS weld symbols chart
  • Steel detailing chart
  • Hole & slot sizes
  • Bolt edge distance
  • ANSI & ARCH paper sizes
  • How to fold an A1 drawing

Useful links

  • CAD blocks (DWG)
  • Revit families
  • structuraldrafter.com
  • cad-corner.com
  • About
  • Privacy policy

Provided for free with no warranty · Log in