AutoCAD – Drawings

Editing text in bulk in AutoCAD: one command changed 551 lines

Editing text in bulk in AutoCAD is not clicking line by line. One single command changes the font on 551 lines without touching an object.

  • TS. Đỗ Quốc Hoàng
  • 9 min read
Six lines of text sharing one text style, all six changed to a new font by a single command Photo: AutoCAD 2027

The project is renamed, the member marks change, the office standard calls for a different font. The drafter opens the drawing and starts double-clicking line by line. An afternoon disappears.

Editing text in bulk has three tools that do the same work in seconds, and this article covers all three on AutoCAD 2027. For the whole text and table workflow, see the AutoCAD for Construction course.

Where to start the find and replace command

Read straight out of the 2027 configuration files.

RouteDetail
Full commandFIND, opens the find and replace dialog
Aliasnone
Ribbonno button
Classic menuEdit → Find
ToolbarText → Find
KeyboardCtrl + F

There is no alias, but the familiar Ctrl + F works and is the quickest way in.

The steps, one by one

This command opens a dialog rather than asking at the prompt, so the steps are actions inside that dialog.

StepWhat you do
1Type what to look for in the Find what box
2Type the replacement in the Replace with box
3Choose the scope: the whole drawing, or only the current selection
4Click Replace All; the program reports how many were changed

Step 3 is where care pays. Leave the scope at the whole drawing and replace a short string, and you will hit places you never meant to: replacing "1" with "2" reaches every number containing a one.

The count reported at step 4 is worth reading. It tells you at once how many places changed, and whether that matches what you expected.

How much text a real drawing holds

Before the tools, look at the numbers. These are every piece of text in a structural plan in production use at the Institute.

Text styleObjects
RMS551
ROMANS376
VN144
TU-195
TRUNG48
STANDARD14
Total1,333

Thirteen hundred pieces of annotation in one drawing, and editing text in bulk is the only sane way through them. At three seconds each, double-clicking through them is over an hour without a break. That is why the three tools below matter.

The text style holds the font, not the text

This is the most common misunderstanding. The font does not live on each piece of text; it lives on the text style. Change the style's font and every piece of text using that style follows instantly.

On the drawing above, style RMS was using romans.shx with the big font vns.shx. One -STYLE command changes it to simplex.shx throughout.

MeasurementResult
Font of style RMS beforeromans.shx, big font vns.shx
Font after one -STYLE commandsimplex.shx
Text objects that changed551
Style code stored on each objectstill RMS, unchanged

That last row is the important one. Not a single text object was edited. They all still point at style RMS; only the definition of the style is different.

Six lines of text sharing one text style. Left uses romans.shx, right is after one -STYLE command switched it to italicc.shx. No object was selected or edited Photo: AutoCAD 2027

The prompts, copied verbatim from the 2027 release.

Enter name of text style or [?] <TU-1>:

Specify font name or font filename (for SHX) <romans.shx,vns.shx>:

Specify height of text or [Annotative] <0.0>:

Answer the first two, press Enter through the rest, and the whole drawing has a new font.

FIND does both halves of find and replace

When the content has to change rather than the font, the tool is FIND. Autodesk's FIND page puts it in one line: "Finds the text that you specify, and can optionally replace it with other text."

The word worth noticing is optionally. Plenty of people use it only to search and never realise it replaces.

The tidiest route for renaming a project across a drawing:

  1. Type FIND and press Enter.
  2. Put the search string in the upper box and the replacement in the lower one.
  3. Set the scope to the entire drawing.
  4. Click replace all.

Its advantage over clicking line by line is that it reaches places you would not think of: attribute values inside blocks, text in tables, dimension text overrides. Double-clicking either cannot reach those or you simply forget them.

One habit worth keeping: the replace is not case sensitive unless you tick the box for it. Renaming member marks with that box unticked is an easy way to change the wrong thing.

An object filter picks exactly the group you want

FIND changes content and -STYLE changes fonts. To change height, layer, colour or style for a group, use QSELECT with the Properties palette.

Four steps:

  1. Type QSELECT.
  2. Set the object type to Text or Mtext.
  3. Add a filter — text style equals RMS, or layer equals TEXT.
  4. Click OK and the group is selected; open Properties and change one field for the lot.

The strength here is how flexible the object filter is. Filter by text height to find lines set to the wrong size, by layer to clean up text drawn on the wrong one, by colour to find text with a hard-coded colour instead of ByLayer.

On the 1,333-object drawing above, filtering by text style returns exactly 551 objects in under a second.

Three tools for three kinds of annotation edit

Reaching for the wrong one wastes the most time, so this table is worth remembering.

To changeUseNote
Text contentFINDreaches text inside blocks and tables
Font-STYLEone command for every line using that style
Height, layer, colour, styleQSELECT then Propertiesfilters on many conditions
Line after line, by handTEXTEDIT with Multipleclick through without restarting the command

The last row is little known. TEXTEDIT has an option that lets you click from one piece of text to the next without leaving the command, which suits work where every line is different and nothing can be automated.

The Vietnamese font trap when changing in bulk

Changing the font across a drawing is quick, but Vietnamese drawings carry a trap.

The RMS style used romans.shx with the big font vns.shx. That big font is exactly what makes Vietnamese diacritics appear under the old code page. Change the font and forget to re-declare the big font and every accent disappears.

The prompt offers the pair right there in the angle brackets:

Specify font name or font filename (for SHX) <romans.shx,vns.shx>:

The comma between the two names is how a font and its big font are declared together. To change the main font while keeping the big font, type both, separated by a comma. Vietnamese font support in AutoCAD is covered in detail in our article on exporting point coordinates, which includes a test of all 41 Unicode .shx fonts that ship with the software.

What an object filter can key on

The filter list in QSELECT is longer than most people scroll through. These are the conditions worth knowing for text work.

ConditionWhat it catches
Text styleevery line using one style, ready for a batch change
Heightlines set to the wrong size by an earlier drafter
Layerannotation drawn on the wrong layer
Colourtext with a hard-coded colour instead of ByLayer
Contentstext matching a wildcard pattern, such as COT*

The last one overlaps with FIND but behaves differently. FIND walks through matches and replaces them; the filter hands you a selection set you can then edit however you like in Properties. For changing height and layer at once on everything whose text begins with a given prefix, the filter is the shorter route.

Try it on a copy before replacing across a set

Replacing in bulk is as fast at going wrong as it is at going right. Three habits cost seconds and save afternoons.

First, search before you replace. Click find to see the result list before clicking replace all. Far more hits than you expected means the search string is too short.

Second, longer search strings are safer. Changing mark C1 to C1a by searching for just those two characters catches C12 and C15 as well. Search for a longer phrase and the risk drops away.

Third, check immediately after replacing. Look over the result straight away rather than moving on to other work. The more you do in between, the harder it is to unwind, and some mistakes only show up on a careful read of the whole drawing.

For a set of files, the safest route is still to copy the whole folder and work on the copy. Batch file handling is covered in our article on saving to an older AutoCAD version.

Three things often repeated that are not true

Often repeatedWhat the 2027 release actually does
To change the font you must select all the textChange the style's font instead; 551 lines changed with nothing selected
FIND only finds, it cannot replaceAutodesk states it "can optionally replace it with other text"
Text inside a block can only be edited by exploding itFIND reads attribute values inside blocks

Frequently asked questions

Which command edits text in bulk?

It depends what you are changing. Content takes FIND, fonts take -STYLE, and height or layer take QSELECT followed by Properties.

Does changing the font damage the text?

No. The style code, read back off every object afterwards, still says RMS. Only the style definition changed.

All my Vietnamese accents vanished after changing the font.

Re-declare the font together with its big font, separated by a comma, for example romans.shx,vns.shx at the font name prompt.

Does FIND search inside blocks?

Yes. That is precisely its advantage over double-clicking each piece of text.

How do I select only the lines set to the wrong height?

Type QSELECT, set the object type to Text, add a condition on height matching the wrong value, then fix the whole group in Properties.

About the author

TS. Đỗ Quốc Hoàng — Vice Director of the Institute of Information Technology in Civil Engineering, Hanoi University of Civil Engineering, and a specialist in software development for construction