How do I change the TEXT STYLE / font across hundreds of drawings?


A classic batch job: you need to switch every piece of text from one style to another — say from romans.shx to tahoma — across a few hundred drawings, and you don't want to open each one by hand. Hurricane runs a short script across your whole drawing set to do it in one pass.

The tool: Autodesk's CHTEXT.LSP (the CHT command)

The most reliable way to reassign text objects to a different style is Autodesk's own CHTEXT.LSP, which adds the CHT ("Change Text") command. Autodesk stopped shipping it in newer releases, so a copy is hosted on the Hurricane forum:

Get the LISP: download chtext.zip from CHTEXT.LSP (Change Text) on the Hurricane Forum, then load it (manually with APPLOAD, or auto-load it — see How do I run a Lisp routine on all my files?).

The Hurricane user-script

Once CHT is available, this is the script Hurricane runs against each drawing. Blank lines are Enter keystrokes — they matter, so keep them:

CHT            ; start Autodesk's Change Text (chtext.lsp)
ALL            ; "Select objects:" -- grab every text object
               ; (Enter) finished selecting
S              ; choose the Style option
               ; (Enter) apply to ALL the selected text
THE_NEW_STYLE  ; the text style to switch everything to
               ; (Enter) exit the command
REGEN          ; redraw so the change shows

Replace THE_NEW_STYLE with the name of the destination text style (the style must already be defined in the drawing, or in your template). Drop this into Hurricane, point it at your folder of drawings, and run.

Alternative — redefine the style instead of reassigning text: if every drawing already uses one named style and you only need to change the font behind it, you can redefine that style's font with the command-line -STYLE command. Every text object using the style then updates automatically — no need to re-select text. Which approach is better depends on whether your drawings use a single shared style or many.
AutoCAD LT: CHT is a LISP routine, so it needs full AutoCAD (or an LT LISP add-on). See AutoCAD LT won't run LISP… BUT…
💬 From the Hurricane Forum: Change text style on 200 drawings (the script above) · CHTEXT.LSP download & usage · Changing MText font style

Related


PreviousBack to Hurricane for Autodesk® AutoCAD® - FAQNext