I had a question last week, asking if there is any AutoLISP program to find a specific text and replace it with another text. I decided to answer the question by publishing this article, instead of replying the email. So more people can read the answer.
You don’t need AutoLISP to do that. If you go to annotate tab, in text panel, you can find a small search box. That’s probably why it’s not so easy to find.
We just need to type the word or phrase we want to find, then press enter.
You will see AutoCAD open search dialog box. AutoCAD will also zoom to first text it find.
Tips: you can open ‘find and replace dialog box’ by typing FIND [enter] in command line
Type what text you want to replace with then click replace. You can limit your searches to current space (model or layout), selected objects, or entire drawing.
More find options
Click button to expand the find dialog box. You can refine your search further by using these options.
Yes, it can find text in blocks or xref too. But it can’t find value in fields. I think it will be great to find values in field to, because sometimes we need to review fields values.
For additional information, we also have spell checker in AutoCAD.
It works almost the same with find and replace text, only here, we compare it to AutoCAD dictionary.
Jika mencari text di autocad 2007 bagaimana pak
Is there any text equivalent of TAB so that I can incorporate this command in scripts?
If you use AutoCAD, you can use \t. But this is an AutoLISP command, so it will not work for AutoCAD LT. Read more about control character string here.
How can you delete a text that has been found with Find and Replace?
For example I’ve got a drawing full of attributes containing various velocities – 50 km/h, 75 km/h, 100 km/h etc.
I’d like to search the whole drawing and delete all velocities. The best I could achieve so far is replacing them with a space.
If they are texts, you can use FILTER or QSELECT to select them by contents. But it doesn’t work if the texts are inside blocks.
I’ve got problem with find and replace.
For example, I want to replace “B1,B11 and B110” with – “BA – A2”
what i do is
1. I type “B” in find what box. Then I press find
2. There is so many result from B1 to B212
3, Then I type BA-A2 in replace with box
4. I highlighted B1, B11 and B110
5. When i press replace it changed to BA-A21 , BA – A211 , and BA – A2110
It only replaces the B not the whole text, can you help me with this?