BIM

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

Editing text in bulk in AutoCAD is not clicking line by line. We measured one command changing the font on 551 lines without touching an object.

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

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 measures all three on AutoCAD 2027 at the Institute. For the whole text and table workflow, see the AutoCAD for Construction course.

How much text a real drawing holds

Before the tools, look at the numbers. We counted 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.

We measured it on the drawing above. Style RMS was using romans.shx with the big font vns.shx. One -STYLE command changed it to simplex.shx, and we read everything back.

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.

One command changing the font on all six lines Photo: 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

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 returned exactly 551 objects in under a second. We measured that by running the filter and counting the result.

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 we measured 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. We measured Vietnamese font support in AutoCAD 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 we measured on the 2027 release
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. We read the style code back off every object afterwards and it still said 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