Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Batch Find and Multiple Replace

16 REPLIES 16
SOLVED
Reply
Message 1 of 17
Anonymous
3166 Views, 16 Replies

Batch Find and Multiple Replace

I'm needing help locating a program that can find an input on multiple lists but that input can be replaced by different outputs per list. 

 

Ex: I have a text input BK|P on 50 lists, I want to change that to different variants of BK(|K,|J,|H.... etc) but without having to find and replace for each list. I want to have that input for each list all up at the same time so just a simple type and click can have them all changed and saving me hours of editing. Please help.

16 REPLIES 16
Message 2 of 17
JTBWorld
in reply to: Anonymous

We might have something for you like JTB Batch Change or can create a custom solution. 


Jimmy Bergmark
JTB World - Software development and consulting for CAD and license usage reports
https://jtbworld.com

Message 3 of 17
Anonymous
in reply to: JTBWorld

Going to check it out in a few minutes! Thank you for the quick reply.

Message 4 of 17
timothy_crouse
in reply to: Anonymous

Find Dialog >>  Is there a reason the "REPLACE ALL" function will not work?

This does not require any interaction other than entering the initial string sets(s).

 

-Tim C.

Message 5 of 17
Kent1Cooper
in reply to: Anonymous

Questions arise....

 

In what form do you have the 50 lists?  Are they each stored under their own variable name?  Or a single list of 50 sub-lists?  Something else?

 

Does position in the list matter?  It should be pretty simple to remove a "BK|P" item from any list that contains one, and tack a "BK|J" [etc.] item onto the front of the list.  If the replacement needs to be in the same place, it's more complex but certainly possible.

 

Should the variants be generated by something like simply stepping through the alphabet, or do you have specific variants in mind?

 

Does it matter what final-letter variant goes into the entry in any given list?  Or should whatever variant comes next be given to whatever list comes next?

 

50 is more than the available letters for after the | character.  Should there be repeats after the alphabet is exhausted?  Double letters? Numbers?  Letter-number combinations like "BK|A1"?  Punctuation characters?

 

Should "BK|P" be skipped over if stepping through the alphabet, or is it acceptable for one list [or more than one if repeats are allowed] to contain that in the end?

 

Etc., etc.

Kent Cooper, AIA
Message 6 of 17
Kent1Cooper
in reply to: Kent1Cooper


@Kent1Cooper wrote:

Questions arise....


... and I guess the big one that didn't even occur to me before:  What are  these lists?  I assumed an AutoLisp-type list of text string items, such as ("BK|P" "Manny" "Moe" "Jack"), but someone suggested using FIND, which would not be appropriate unless you're talking about Text or Mtext or Attributes or some such thing.  Is a list an Mtext object perhaps with a new line for each "item" in it, and "BK|P" on one of the lines?  If it's something like a stack of separate Text objects, from AutoCAD's perspective they are independent, and their constituting a "list" would only be by positional relationship.  Are they Tables, perhaps?

Kent Cooper, AIA
Message 7 of 17
devitg
in reply to: Kent1Cooper

@Anonymous all @Kent1Cooper  questions and guessing , can be solved with  samples , DWG and or LSP.  

 

 

Message 8 of 17
Anonymous
in reply to: Kent1Cooper

I am going to try to answer your questions as best as I can (Still a little bit of a novice when it comes to AutoCAD):

 

1.)These are DWG files

 

2.) Yes, position does matter

 

3.) Specific variables in mind

 

4.) Given to whatever list comes next

 

5.) Yes some will double letters and may add numbers (its all based on the part number it is being replaced with)

 

6.) It will be acceptable if there are repeats. 

 

Thank you for the response and I hope to hear back from you soon.

Message 9 of 17
devitg
in reply to: Anonymous

@Anonymous , a sample DWg , will clear all doubt. Do not be afraid, an upload do not transmit COVID19

 

Message 10 of 17
Anonymous
in reply to: Kent1Cooper

These are the kind of drawings that I am working with.

Message 11 of 17
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:

These are the kind of drawings that I am working with.


And what in that drawing contains or constitutes your 50 or so lists, whatever they are?  FIND finds 55 instances of "BK|", but none of "BK|P".

Kent Cooper, AIA
Message 12 of 17
Anonymous
in reply to: Kent1Cooper

That was just an example in the 50 or so list I will be changing the section where BK|J is.

Message 13 of 17
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:

That was just an example in the 50 or so list I will be changing the section where BK|J is.


I'm still confused by your use of the word "list," which has a specific meaning in AutoLisp terminology, but nothing in your drawing seems like it could be related to that.  All instances the FIND command finds of "BK|J" are in Block Attributes, and there are only four of them.  Can you describe in more detail, using AutoCAD's words for things, exactly what you want to change?

Kent Cooper, AIA
Message 14 of 17
Sea-Haven
in reply to: Anonymous

Lee-mac.com has a batch find and replace may be useful. Maratovich has one also just google name + Autocad.

Message 15 of 17
Anonymous
in reply to: devitg

I posted a sample up above.

Message 16 of 17
Anonymous
in reply to: Sea-Haven

I use the BFind from Lee mac and it is almost what I am looking for, but it does not allow multiple outputs (Just a single input on multiple drawings to be changed to the same output).

Message 17 of 17
Sea-Haven
in reply to: Anonymous

As lee's code is provided as source can normally make it repeat and skip say screen entry you may want to contact Lee direct.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report