|
Well, having it run through a SCR file is really not dificult. E.g. make your SCR file as so:So you can have this working through ScriptPro, or if you're on 64bit use AutoScript.Code:(load "FileName.LSP") (function_name arg1 arg2) CommandName Input1 Input2
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.
I get an error that says
VLA-OBJECT nil
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?
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)
Hi to all,
I am running the routine and displays the following message:
But these drawings are not open.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:
Could anyone help me with this?
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) )