Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Find and Replace text in multiple drawings

  1. #11
    I could stop if I wanted to
    Join Date
    2005-12
    Location
    San Luis Obispo, CA
    Posts
    285
    Login to Give a bone
    0

    Default Re: Find and Replace text in multiple drawings

    Quote Originally Posted by eugene_k View Post
    I believe those people capable of doing this level of lisp programing could do much better job by creating a universal code for batch processing various lisp files on multiple drawings. Instead of solving just one problem of text replacement, we couls just start this batch engine program, select the files to be processed and then select a lisp to run! It could be lisp for text replacement or for anything else - you name it. This is where the real power is. Maybe Autodesk should provide this sort of engine instead of its ScriptPro...
    There is no good tool availbale at the moment. If anybody ever find something good, please let me know!
    not available for free, but available none the less and has been for some years
    Attached Images Attached Images

  2. #12
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Find and Replace text in multiple drawings

    Quote Originally Posted by eugene_k View Post
    I believe those people capable of doing this level of lisp programing could do much better job by creating a universal code for batch processing various lisp files on multiple drawings. Instead of solving just one problem of text replacement, we couls just start this batch engine program, select the files to be processed and then select a lisp to run! It could be lisp for text replacement or for anything else - you name it. This is where the real power is. Maybe Autodesk should provide this sort of engine instead of its ScriptPro...
    There is no good tool availbale at the moment. If anybody ever find something good, please let me know!
    Well, having it run through a SCR file is really not dificult. E.g. make your SCR file as so:
    Code:
    (load "FileName.LSP")
    (function_name arg1 arg2)
    CommandName Input1 Input2
    So you can have this working through ScriptPro, or if you're on 64bit use AutoScript.

    And BTW, there is already something which simply runs a LSP file on multiple DWG's. It basically just creates the SCR file and then runs it. It's called BatchLisp.

  3. #13
    Woo! Hoo! my 1st post
    Join Date
    2010-11
    Posts
    1
    Login to Give a bone
    0

    Default Re: Find and Replace text in multiple drawings

    I get an error that says

    VLA-OBJECT nil

  4. #14
    Woo! Hoo! my 1st post
    Join Date
    2010-02
    Posts
    1
    Login to Give a bone
    0

    Default Re: Find and Replace text in multiple drawings

    hi!

    I'm using AutoCAD 2009, and i've received de error message:"; error: no function definition: VLAX-GET-ACAD-OBJECT"
    Can u please help?

  5. #15
    I could stop if I wanted to
    Join Date
    2009-03
    Location
    London, England
    Posts
    304
    Login to Give a bone
    0

    Default Re: Find and Replace text in multiple drawings

    Quote Originally Posted by carlosmanteigas View Post
    I'm using AutoCAD 2009, and i've received de error message:"; error: no function definition: VLAX-GET-ACAD-OBJECT"
    Can u please help?
    Add:

    Code:
    (vl-load-com)
    On a new line at the end of the file.

  6. #16
    Woo! Hoo! my 1st post
    Join Date
    2010-04
    Posts
    1
    Login to Give a bone
    0

    Default Re: Find and Replace text in multiple drawings

    when i add the (vl-load-com) i get a new error:

    Loaded new command Reid.
    [c]2004 Andrzej Gumula.
    Command: reid
    ; error: Automation Error. Problem in loading application

    Using Acad 2012
    (this is version 18.2 so i am not sure about the version part of the LSP)

  7. #17
    Member
    Join Date
    2010-09
    Posts
    24
    Login to Give a bone
    0

    Default Re: Find and Replace text in multiple drawings

    Quote Originally Posted by jsowinski View Post
    Here is a routine that came from Cadalyst Tips (author - Andrzej Gumula). This is a great tool that works fast. If you encounter an error while running you will want to check the part of the code that looks for (getvar "AcadVer"). "ObjectDBX.AxDbDocument.17" You may have to update the number in the lisp to the version of AutoCAD you're using.
    Hi to all,
    I am running the routine and displays the following message:
    Loaded new command Reid.
    [c]2004 Andrzej Gumula.
    Command: REID

    Looking for text to replace. Please wait...

    Cannot find in C:\_TEST\TEST-01.dwg. Probably drawing is open now.
    Cannot find in C:\_TEST\TEST-02.dwg. Probably drawing is open now.
    Cannot find in C:\_TEST\TEST-03.dwg. Probably drawing is open now.
    ERROR: bad argument type: VLA-OBJECT nil
    Command:
    But these drawings are not open.
    Could anyone help me with this?

  8. #18
    I could stop if I wanted to
    Join Date
    2002-08
    Posts
    231
    Login to Give a bone
    0

    Default Re: Find and Replace text in multiple drawings

    If you want try this...

    You must save the lisp file "my_text_replace.lsp" in path (or create it) for AutoCad.
    And after in new drawing load the code next

    Code:
    (defun c:make_script_for_text_replace ( / prefix file_scr old_str new_str)
    	(setq
    		prefix (strcat (vl-filename-directory (getfiled "Select a drawing file for folder target" "" "dwg" 16)) "\\")
    		file_scr (open (strcat prefix "job_on_folder.scr") "w")
    	)
    	(princ "\nBe careful with the case of character!")
    	(setq
    		old_str (getstring T "\nOld chain of character to replace: ")
    		new_str (getstring T "\nBy new chain of character: ")
    	)
    	(foreach dwg (vl-directory-files prefix "*.dwg" 1)
    		(write-line "_.open" file_scr)
    		(write-line (strcat "\"" prefix dwg "\"") file_scr)
    		(write-line "(load\"my_text_replace\")" file_scr)
    		(write-line (strcat "(my_text_replace \"" new_str "\" \"" old_str "\")") file_scr)
    		(write-line "_.qsave" file_scr)
    		(write-line "_.close" file_scr)
    	)
    	(close file_scr)
    	(princ (strcat "\nYou can run the SCRIPT :" prefix "job_on_folder.scr"))
    	(prin1)
    )
    Attached Files Attached Files

  9. #19
    Member
    Join Date
    2010-09
    Posts
    24
    Login to Give a bone
    0

    Default Re: Find and Replace text in multiple drawings

    Quote Originally Posted by Bruno.Valsecchi View Post
    If you want try this...

    You must save the lisp file "my_text_replace.lsp" in path (or create it) for AutoCad.
    And after in new drawing load the code next

    Code:
    (defun c:make_script_for_text_replace ( / prefix file_scr old_str new_str)
    	(setq
    		prefix (strcat (vl-filename-directory (getfiled "Select a drawing file for folder target" "" "dwg" 16)) "\\")
    		file_scr (open (strcat prefix "job_on_folder.scr") "w")
    	)
    	(princ "\nBe careful with the case of character!")
    	(setq
    		old_str (getstring T "\nOld chain of character to replace: ")
    		new_str (getstring T "\nBy new chain of character: ")
    	)
    	(foreach dwg (vl-directory-files prefix "*.dwg" 1)
    		(write-line "_.open" file_scr)
    		(write-line (strcat "\"" prefix dwg "\"") file_scr)
    		(write-line "(load\"my_text_replace\")" file_scr)
    		(write-line (strcat "(my_text_replace \"" new_str "\" \"" old_str "\")") file_scr)
    		(write-line "_.qsave" file_scr)
    		(write-line "_.close" file_scr)
    	)
    	(close file_scr)
    	(princ (strcat "\nYou can run the SCRIPT :" prefix "job_on_folder.scr"))
    	(prin1)
    )
    Thanks Bruno.
    This routine worked for me.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Find and Replace for Multiple Drawings
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 3
    Last Post: 2015-10-07, 11:07 AM
  2. 2011: Replace block in multiple drawings
    By swapr78 in forum ACA General
    Replies: 12
    Last Post: 2013-09-05, 04:37 PM
  3. Text find and replace
    By Wish List System in forum Inventor Wish List
    Replies: 0
    Last Post: 2012-11-13, 03:48 PM
  4. Text Find and Replace
    By madyb in forum Revit Structure - General
    Replies: 3
    Last Post: 2009-10-29, 07:40 PM
  5. Multiple Find and Replace
    By cjshaw in forum AutoCAD LT - General
    Replies: 4
    Last Post: 2007-02-05, 08:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •