Jump to content

Batch Find & Replace Text


Lee Mac

Recommended Posts

Batch Find & Replace Text

 

The user may replace multiple search strings, and load & save lists of search strings for future use, saving time in program data entry.

.[/color][/b][/font]

 

at first thx for the code its very good .. and the list option it what i need so thank you too much but i want to know is there any way to edit this saved list cuz i have too much text to change and i made it in Excel file . so i want to take it copy and paste it in the list saved file that made by bfind but i cant find it and dont know how bfind save this list and where so i hope to help me and thanks in advance

Link to comment
Share on other sites

i found it bro and many thanks for this option :D now i will try to change the text in the list file and i will save it then i will try to call it by the bfind if it work it will save too much time 8)

Link to comment
Share on other sites

You're welcome medo - I'm glad the program will help you.

 

For others reading this thread, the text file containing the saved search items (providing some find/replace items have been saved) can be found by typing at the AutoCAD command-line:

(findfile "LMAC_BFind_SavedSearches_V2-0.txt")

Lee

Link to comment
Share on other sites

  • 9 months later...
Is it normal if the code run for 2-3 hours for a list of 200 replacements??

 

2-3 hours certainly seems like a long time... but it would depend on the number of drawings you are processing and the size of each drawing...

Link to comment
Share on other sites

2-3 hours certainly seems like a long time... but it would depend on the number of drawings you are processing and the size of each drawing...

 

I ran on only 1 file at a time. The file had ~250 positions of text, mtext, attributes weigh at 4.5 mb. The first time I ran and Autocad hang (not responding) then I thought it crashed. Second try I let alone, the job was done in 3 hours. Everything is perfect except the long running time.

I am wondering if there is any parameter setup required prior to running LISP

I am using Autocad 2013 on i7 cpu.

Anyhow Lee, your Batch and Find is a brilliant idea that official Autocad missed for very long time. Thanks

Link to comment
Share on other sites

  • 1 month later...

Hi Lee

 

Just looking at the code listing at http://www.lee-mac.com/lisp/html/BFindV2-0.html around line 1235 onwards, it appears to be missing the Regex to find strikethroughs which is \K & \k as per http://www.cadforum.cz/cadforum_en/text-formatting-codes-in-mtext-objects-tip8640. I tested "\Ktext\k" in MText in v2015 and it works. I think it may also be missing from http://www.lee-mac.com/unformatstring.html too.

 

The height control code looks like it may be absolute or relative so the X at the end of the Regex is optional - "H[0-9]?[.]?[0-9]+x?;" http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%202010%20User%20Documentation/index.html?url=WS1a9193826455f5ffa23ce210c4a30acaf-63b9.htm,topicNumber=d0e123454

 

If you haven't already discovered it (it was mentioned earlier) RegexBuddy will save your sanity .. as much as it is possible to stay sane doing Regex.

 

Love your work!

cheers

Ewen

Link to comment
Share on other sites

  • 3 weeks later...

:) This is a great LISP thanks a lot Lee, and for what I've read it works really nice for some people. But after I give all the parameters the command Line says:

 

Command: BFIND

Select Object:

Working, Please Wait...

** Error: Automation Error. Problem in loading application **

 

I am using Civil 3D 2013, how could I try to fix this isue?

Link to comment
Share on other sites

Hi Chupete,

 

Thank you for your compliments for the program and welcome to CADTutor :)

 

Based on the error message you are receiving it looks as though the program is unable to load the ObjectDBX module required to interface with the selected drawings; I have attached a program which will attempt to automatically find & register the required module on your system - the command for the attached program is 'regodbx'.

 

Please try running the attached program and then restarting AutoCAD before trying my BFind program again.

 

I hope this helps,

 

Lee

RegisterObjectDBX.lsp

Link to comment
Share on other sites

  • 1 month later...

Hi Lee

 

 

Can't get it to load in 2015? See image for error. I've tried the RegisterObjectDBX.lsp‎ but seems like not working in my case. Thanx

BFIND ERROR.png

Link to comment
Share on other sites

Yes same error. Tried it a view times after restarting.

 

 

Edit:

(Sorry let me re-phrase, the application open, but as soon as I try to find the error show's)

Link to comment
Share on other sites

English bad, look at the contents basically rely translation,呵呵

用了您的程序,出现这种情况:

命令: BFIND

Working, Please Wait....

** Error Processing Drawing: Drawing1.dwg **

** Error Detail: Win32: 在多字节的目标代码页中,没有此 Unicode 字符可以映射到的字符。 **正在重生成模型。

命令:

>

>

应该是不支持Unicode 字符,各位大神,哥,姐,能不能搞个支持Unicode字符的程序。

Link to comment
Share on other sites

English bad, look at the contents basically rely translation,呵呵

用了您的程序,出现这种情况:

命令: BFIND

Working, Please Wait....

** Error Processing Drawing: Drawing1.dwg **

** Error Detail: Win32: 在多字节的目标代码页中,没有此 Unicode 字符可以映射到的字符。 **正在重生成模型。

命令:

>

>

应该是不支持Unicode 字符,各位大神,哥,姐,能不能搞个支持Unicode字符的程序。

 

Please refer to this post earlier in the thread.

Link to comment
Share on other sites

  • 2 months later...
WTF! Lee, you are like my god! Thank you!!

 

Addition, it would be even better if supporting unicode letters.

 

Welcome to CADTutor naore. :)

 

Yeah, this is an absolutely awesome lisp, Lee rules. :beer:

 

I have had occasion to use it going through a large directory to correct the Steel Grade on lots of drawings, without needing to open a single one, in a minute or so, and then it gives you a spreadsheet, so you can review what it did.

 

Lots of great tools on Lee's site, very generously made available to the global cad community.

I am a huge fan of LAYER DIRECTOR too.

 

Thanks Lee!

Edited by Dadgad
Link to comment
Share on other sites

hi lee am using cad 2014... with some of files I am getting below error.

 

Error:

Working, Please Wait....; error: Exception occurred: 0xC0000005 (Access Violation)

; warning: unwind skipped on unknown exception

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

LEE thank you very for the awesome program, like all yours! :shock::shock::shock:

I'm wondering if it possible to load a list of text and the "to replace" text and no to digit one after the other..

 

In my example I have to replace a list of chainages to the new one but it will be faster if I could load the list from csv, txt format file or other..

 

I hope I explained...

 

thank you and thank you all in advance :roll:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...