Jump to content

Replace texts with others without opening files (* .dwg)


Galtar53

Recommended Posts

Good evening,
I need a lisp to read several files (* .dwg) and replace texts by other texts following a list (* .csv), without opening the files (* .dwg).
Link to comment
Share on other sites

 

Thank you, yes it works well, but for a single text, and if I have a lot of text to replace how should I do? the problem that I have a lot of modification on files and I cannot do that manually, I already have a list of the texts and replacing them on excel. can you help me find a solution, thank you

Link to comment
Share on other sites

You can add any number of different TEXT items which you want to change into the dialog box.

In one pass it will go through a whole folder or directory and replace them all, without even opening them.

It will also print out an excel afterwards describing all the changes which were made in each specific .dwg file.

If these are changes which you might frequently have occasion to use, you can save them, so that in the future you will have them available without the need

to recreate them.  I do not write lisp, but find BFIND to be very powerful and well designed (of course, because Lee-Mac is the Prince of Lispness :beer:).

 

Describe each of the FIND WHAT and REPLACE WITH vales at the top, then hit ADD.

Add as many as you want, then hit SAVE, and name that group of changes in case you might need it again later.

Should you ever need to use a SAVED group of defined Replace Values another time, just call up BFIND, then use the LOAD option to access the Load Search Items List.  This lisp is absolutely Golden. 

Thanks again Lee!   :beer:

 

Consider the OPTIONS available in the bottom part of the dialog.

 

image.thumb.png.942240744a763f1381fb51fdb59e280b.png

Edited by Dadgad
Screenshot added.
Link to comment
Share on other sites

 

Hello, I used your beautiful lisp "BFIND" and it works well, but I have a problem if I have a lot of texts to replace, of course the lisp does that but it does it text by text, and I have a list of 17000 texts to replace on several file "* .dwg) without opening them, how I should do to add the texts and their substitutes,thank you

Link to comment
Share on other sites

Beautiful, "Batch Find & Replace" is, but it isn't mine, it is the Brainchild of Lee-Mac.   :beer:

 

It is none of my business, but I am reasonably mind-blown that you have a list of 17,000 texts which need to be found and replaced.

Can't begin to imagine how you have gotten to such a point.   :huh:

Let alone having 17,000 text entries period.

 

Time to call in the A-Team Lisperatti, and jump to warp-speed!

 

Good luck with it.

 

 

Edited by Dadgad
Link to comment
Share on other sites

22 minutes ago, Dadgad said:

Magnifique, "Batch Find & Replace" est, mais ce n'est pas le mien, c'est le Brainchild de Lee-Mac.   :Bière:

 

Cela ne me regarde pas, mais je suis raisonnablement stupéfait que vous ayez une liste de 17 000 textes qui doivent être trouvés et remplacés.

Je ne peux pas commencer à imaginer comment vous en êtes arrivé à un tel point.   : huh:

Sans parler de la période de 17 000 entrées de texte.

 

Il est temps d'appeler l'A-Team Lisperatti et de passer à la vitesse de distorsion!

 

Bonne chance.

 

 

Ok thank you.

Link to comment
Share on other sites

As a start you could look at this:

 

https://www.augi.com/forums/showthread.php?43053-Take-existing-drawings-and-find-all-quot-quot-and-replace-with-quot-1-4-quot&p=521248&viewfull=1#post521248

 

which will find and replace text exactly as it is entered (case sensitive too), it will fail with longer mtexts. It is all command line rather than dialogue box and that means you can use it in a LISP,... so all you need now a lisp that will loop through your excel file data, extract the find and the replace and use them in this find-replace.

 

Which will do it for a single drawing - then use Lee Macs script routine to apply it to all the drawings without opening them. I can't help more than this, I haven't ever needed to link up with excel so no nothing about that.

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