Jump to content

Batch Find & Replace Text


Lee Mac

Recommended Posts

If the LISP is in a support path, you could also use perhaps:

 

(if (not (and (setq LISPFile (findfile (strcat "BFind V" VersionNumber ".lsp")))
             (vl-file-directory-p (setq SavePath (vl-filename-directory LISPFile)))))

 

But, this relies on the LISP file not having been renamed, and being situated in a support path so that findfile may find it.

Link to comment
Share on other sites

  • 2 weeks later...

when i use it on Acad2011, this lisp save my drawing in format of Acad2011(in cad option, i selected save to cad 2004). So, everybody not use Acad2011(or 2010) as Acad2006,2008,... can not open my drawing.

I hope you will fix this error. Thanks so much!

Link to comment
Share on other sites

when i use it on Acad2011, this lisp save my drawing in format of Acad2011(in cad option, i selected save to cad 2004). So, everybody not use Acad2011(or 2010) as Acad2006,2008,... can not open my drawing.

I hope you will fix this error. Thanks so much!

 

It's not an error.

 

One cannot save lower than the native version when using ObjectDBX, please re-read the disclaimer before downloading/using the program.

Link to comment
Share on other sites

Is there a way to access the stored values for finding and replacing? That way I could generate the list in Excel and paste it in somewhere.

 

Also, since it is possible to find values and replace them in a set of drawings, would there be a way to easily make a Find only feature so that you could find certain values or references in a group of drawings?

Link to comment
Share on other sites

The find/replace string saved searches are stored in the file in this location:

 

type at the command line:

(findfile "LMAC_BFind_SavedSearches.txt")

 

As for the Find Only: tick the 'Search Only' box.

Link to comment
Share on other sites

Wow, this program is amazing. Thanks.

 

The find/replace string saved searches are stored in the file in this location:

 

type at the command line:

(findfile "LMAC_BFind_SavedSearches.txt")

 

As for the Find Only: tick the 'Search Only' box.

Link to comment
Share on other sites

I don't know if this was asked or not, but I would assume there is a way(line command) to get the folder that the current drawing is located in. Could that location then be applied to the program so that there were actually three selections down on the bottom; "Include Sub-Directories","Current Drawing Only",and "Current Director and Sub-Directories Only"? Or if not that, maybe have the current location come up when you click the Directory botton so that you don't have to navigate to the current location? Thanks.

Link to comment
Share on other sites

Thanks :)

 

Or if not that, maybe have the current location come up when you click the Directory botton so that you don't have to navigate to the current location?

 

I investigated to see whether this was possible, but I don't think the BrowseForFolder method offers that option (without perhaps using a lower-level language) - the directory that you have used for the find/replace will be saved however, and this will be the current directory when the program is run for the first time.

 

Lee

Link to comment
Share on other sites

  • 2 weeks later...

u added an option : Block Attribute. When I find and replace text in normal block, it can't be done. So, i hope that u will add option for normal block.

thanks.

Link to comment
Share on other sites

u added an option : Block Attribute. When I find and replace text in normal block, it can't be done. So, i hope that u will add option for normal block.

thanks.

 

This would require digging through block definitions in addition to those objects in the drawing - not impossible, but not a simple addition either and would make the program slower also.

Link to comment
Share on other sites

Hi lee,

 

i've been coming to this forum for a week for tips and solutions, but didn't became a member until i saw this thread.

great work with the bfind lisp!

 

Would it somehow be possible to also make bfind scan dxf files? i'm in a situation where most drawings are stored as dxf for compatibility with an old laser cutter, and some people over here

tend to be sloppy with proper filenaming, so sometimes when we need a certain file we have to open 30 files to check for the mtext content we want to find, manually :reallymad:.

Link to comment
Share on other sites

Hi,

 

I'm glad you like the program :)

 

I'm not sure however that the DXF file format is compatible with ObjectDBX (this is what the program uses to process drawings).

 

Lee

Link to comment
Share on other sites

  • 8 months later...

Hi Lee, I used BFIND again today to make quick work of a reviewer comment for the verbiage used to label something throughout our plan set (Thank you!).

 

That said, today I noticed something that I feel would help, and that is if when navigating to a new project directory, if either you could select "use current directory" or if the navigator allowed double-clicking of shortcuts, or both?

 

Just a thought - you know I'm a fan of this tool regardless.

 

Cheers! :beer:

Link to comment
Share on other sites

:lmfao:

 

If you thought that was funny, I have a good candidate for the "out of context" thread:

 

insertobj

 

i usually select my foot ...............

Link to comment
Share on other sites

Thanks Renderman, I'm glad you find the program useful :)

 

That said, today I noticed something that I feel would help, and that is if when navigating to a new project directory, if either you could select "use current directory" or if the navigator allowed double-clicking of shortcuts, or both?

 

One thing I did try to incorporate was the ability for the BrowseForFolder method to 'remember' the last selected folder, or indeed, to be able to set a folder as the starting folder when the dialog is displayed. The method does allow a root folder to be supplied, but this doesn't permit the user to browse above this folder, rendering it useless for this application.

 

However, I am in the process of updating this program when I get a moment here and there, so will look to see what improvements I can make to that area.

 

Thanks for the continued feedback, appreciated.

 

Lee

Link to comment
Share on other sites

I've updated this program to Version 2.0

 

The majority of the code for this program has now been rewritten and reformatted in line with my other more recent programs, and the following enhancements have been incorporated:

 

 

  • Added 'Where to Search' panel to the Options dialog to enable users to restrict the Find & Replace operation to Model space, Layout space or both.

 

  • Added ability to perform the Find and Replace operation on objects within Block Definitions.

 

  • Added ability to process All Open Drawings.

 

  • Changed format of Saved Searches file for easier manual editing.

 

  • Added Current Directory toggle to directory selection panel to allow the user to quickly select the current working directory of drawings for processing.

 

  • Fixed tab stops in main dialog so that the user may navigate between the Find and Replace edit boxes more intuitively.

 

  • Incorporated ability to add items to the Find & Replace list by pressing Enter from within either edit box.

 

  • Added ability to press Enter after specifying Save Reference to avoid the need to click the OK button.

 

  • Added ability to press Enter from within either edit box of the Edit Entry dialog, to avoid the need to click the OK button.

 

  • General bug fixes and function improvements.

 

The latest version can be found on my site here or in the first post of this thread.

 

Enjoy!

 

Lee

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...