Frequent contributor Matt Sibum is back with a selection-based find-and-replace routine for text and mtext in AutoCAD. His routine prompts you to select a single text or mtext object, whose text string is saved. Then you are asked to select any number of other text/mtext objects. All entities whose text value matches what you select are replaced with the string from the initial selection. For example, select a text entity containing "Birdhouse," then select one containing "Birdbath"; all instances of "Birdbath" will be replaced by "Birdhouse." Be careful because "My Birdbath" will be replaced with "Birdhouse," not "My Birdhouse."
To use this routine, load the LISP file and type in the command MTA. Depending on your needs, you might want to add undo wrapper, because undoing the effects of a single MTA command can involve several "U" commands. |