AutoCAD 2002 script file trouble
AutoCAD 2002 script file trouble
(OP)
i done a search and did not come up with an answer so i am going to ask.
I am not to familiar with script files and i'm trying to create a script that will allow me to open an AutoCAD 2002 drawing and save it as r14 then close. This much i have accomplished, the problem is i would like it to automatically run through a directory i have selected without writing all of the file names to script as there are about 12,000 files, or possibly a way to link to a text file to accomplish this?? i cannot use any outside software from the company i work because that all has to be tested for months before we can use it. an example would be
open
Q:\drawings.dwg
Q:\drawings.dwg
saveas
r14
yes
i just cannot get the script to complete with successive drawing listed as above and as i stated above i cannot write all that for each of the 12,000 plus drawings.
please help!!!!!!!!!!
I am not to familiar with script files and i'm trying to create a script that will allow me to open an AutoCAD 2002 drawing and save it as r14 then close. This much i have accomplished, the problem is i would like it to automatically run through a directory i have selected without writing all of the file names to script as there are about 12,000 files, or possibly a way to link to a text file to accomplish this?? i cannot use any outside software from the company i work because that all has to be tested for months before we can use it. an example would be
open
Q:\drawings.dwg
Q:\drawings.dwg
saveas
r14
yes
i just cannot get the script to complete with successive drawing listed as above and as i stated above i cannot write all that for each of the 12,000 plus drawings.
please help!!!!!!!!!!





RE: AutoCAD 2002 script file trouble
RE: AutoCAD 2002 script file trouble
open
q:\drawing.dwg
saveas
r14
y
close
12,000 times. if anyone has a script file or any other way of doing it without installing programs, please help me out!
RE: AutoCAD 2002 script file trouble
(defun C:GET_FILES ()
(prompt "\nChoose dwg file in directory")
(setq DIR (getfiled "Script Utility" "" "dwg" 4)
DIR (REMOVE_PATH DIR)
)
(command "SHELL"
(strcat "dir \"" DIR "*.dwg\" > c:\\dwg.dir /b")
)
)
(defun C:CONVERTALL (/ F1) ; start dir f1 f2 rl CNT dirs)
(setvar "CMDECHO" 0)
(setq F2 (open "c:\\convert.scr" "w"))
(close F2)
(setq F1 (open "c:\\dwg.dir" "r")
F2 (open "c:\\convert.scr" "w")
)
(setq CNT 1
DIRS DIR
)
;add extra "\\" for script file
(repeat (strlen DIRS)
(if (= (substr DIRS CNT 1) "\\")
(setq DIRS (strcat (substr DIRS 1 CNT)
"\\"
(substr DIRS (1+ CNT) (strlen DIRS))
)
CNT (1+ CNT)
)
)
(setq CNT (1+ CNT))
)
(while (setq RL (read-line F1))
(setq FILE (substr RL 1 (- (strlen RL) 4))) ; removes ".dwg"
(WRITESCRIPT FILE)
)
(princ "\nNew Y " F2)
(princ "\nConversion_Completed" F2)
(close F1)
(close F2)
(command "_.SCRIPT" "C:\\convert")
(setvar "cmdecho" 1)
(princ "\nComplete...")
(prin1)
)
(defun REMOVE_PATH (FILE)
(while (/= (substr FILE (strlen FILE) 1) "\\")
(setq FILE (substr FILE 1 (1- (strlen FILE))))
)
FILE
)
(defun WRITESCRIPT (FILE)
(princ "open Y" F2)
(princ (strcat "\n\"" DIR FILE "\"") F2)
(princ "\n(load \"convert\")" F2)
(princ "\nMyProgram\n" F2)
)
;;-----------------------------------------------------------------------------
;;Main portion of the program
;;-----------------------------------------------------------------------------
(defun C:MyProgram ()
(princ "\nComplete")
(prin1)
)
RE: AutoCAD 2002 script file trouble
RE: AutoCAD 2002 script file trouble
RE: AutoCAD 2002 script file trouble
Do you want to overwrite your existing drawings
with the saveas R14 drawings?
I have a compiled lisp file that open/plots an existing drawing. I've used this routine in R12 for unattended batch plotting. I could tweak this to open/saveas R14.
I could send you a copy of the program (compiled).
Email me at grevark@aol.com.
RE: AutoCAD 2002 script file trouble
yes, i want to overwrite existing dwgs with r14 format. i dropped you an email, if you dont receive it you can mail me at n.zakowski@mchsi.com.
Admiralken,
i do not have the migration assistant so i cannot use the batch conversion tool.
RE: AutoCAD 2002 script file trouble
RE: AutoCAD 2002 script file trouble
http://www.74mph.com/howitworks.html
This utility is allows you to create script files to process
if you are using Autocad 14, 2000+ & Lt versions. I use the product all the time for large volume drawing production. There are a number of templates and wizard scripts to help you, as well as the facility to create your own. You simply create the script then apply it to as many drawings as you want, the script runs with each drawing being opened,processed then saved/closed.
A must for all productive cad users who want to avoid repetitive tasks.
Regards
Graham Dury
Desco Ltd - England