Print Page | Close Window

modifying text globally

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=5409
Printed Date: 01.Jun.2026 at 00:08


Topic: modifying text globally
Posted By: rmmllla
Subject: modifying text globally
Date Posted: 05.Mar.2011 at 03:16

does anyone know of a way to do the following:

 

in a drawing, there are many text strings containing a numerical value.  i want to change all the text strings with a single command or series of commands (without having to individually change them one by one) so that the original values are retained, but the numbers (numeric text string) are now enclosed inside parentheses.

 

for example:   123.45  becomes  (123.45),  543.21  becomes  (543.21), 234.56  becomes (234.56), etc.



Replies:
Posted By: CarlB
Date Posted: 05.Mar.2011 at 07:27
That calls for a lisp routine, or some programming aproach. Don't know of a way just using commands, such as "FIND", which is used for global text modifying.
 
Here's a simple one, that adds a prefix & paretheses to text entities:
http://www.tek-tips.com/viewthread.cfm?qid=812007&page=22" rel="nofollow - http://www.tek-tips.com/viewthread.cfm?qid=812007&page=22
 
Some more robust ones here, but seem to be for just a prefix or suffix, so you have to run it twice-
http://www.cadtutor.net/forum/showthread.php?1608-Lisp-to-add-a-prefix-or-suffix-to-selected-text" rel="nofollow - http://www.cadtutor.net/forum/showthread.php?1608-Lisp-to-add-a-prefix-or-suffix-to-selected-text
 


Posted By: Vladimir Michl
Date Posted: 06.Mar.2011 at 23:06
Our srxText utility can do this (see Download). Use its the "Regular expressions" option and:

search text: \([0-9\.]+\)
replace text: (\1)




-------------
Vladimir Michl (moderator)
ARKANCE - https://arkance.world" rel="nofollow - https://arkance.world - Autodesk Platinum Partner



Print Page | Close Window