Desperately need help automating
Posted: 06 Dec 2010 00:18
I am new to using batch files and I do not really know what I am doing. I borrowed a friend's files to run various unix programs. It is as follows:
@ECHO OFF
@REM ===========================================
@REM By: Autodesk Ecotect Analysis 2010
@REM ===========================================
@ECHO ECO2RAD: SETTING UP ENVIRONMENT VARIABLES...
@REM ===========================================
SET RAYPATH=.;C:\Radiance\LIB
PATH=C:\Radiance\BIN;C:\Program Files\Autodesk\Ecotect Analysis 2010;$PATH
SET DOS4G=QUIET
@REM ===========================================
@ECHO ECO2RAD: DELETING AMBIENT AND OCTREE FILES...
@REM ===========================================
IF EXIST test_grid(3).oct DEL test_grid(3).oct
IF EXIST test_grid(3).amb DEL test_grid(3).amb
IF EXIST test_grid(3)*.pic DEL test_grid(3)*.pic
IF EXIST test_grid(3).ok DEL test_grid(3).ok
@REM ===========================================
@ECHO ECO2RAD: RUNNING RADIANCE TO GENERATE VIEWS...
@REM ===========================================
RAD -o SVGA test_grid(3).rif
@REM ===========================================
@ECHO ECO2RAD: CALCULATING GRID POINTS...
@ECHO WARNING: THIS COULD TAKE QUITE A WHILE...
@REM ===========================================
rtrace -I -h -dp 2048 -ar 32 -ms 0.063 -ds .2 -dt .05 -dc .75 -dr 3 -sj 1 -st
.01 -ab 8 -aa .1 -ad 512 -as 256 -av 0.01 0.01 0.01 -lr 12 -lw .0005 -af
CAL.amb test_grid(3).oct < test_grid(3).pts > test_grid(3).dat
@RENAME test_grid(3).dat test_grid(3).ok
@ECHO ECO2RAD: GRID POINTS COMPLETE.
@REM ===========================================
@ECHO ECO2RAD: LAUNCHING IMAGE VIEWER...
@REM ===========================================
RadianceIV .\test_grid(3)*.pic
@ECHO ECO2RAD: DONE!
The program launches an image viewer called WINVIEW (rview.exe) which I have to manually close. Once I close the viewer it launches a Radiance Image Viewer (RadianceIV.exe) and gives me the output ascii formatted .OK file.
All I want is the .OK file. This is part of an automatic process that has to happen thousands of times. Can I add any lines to the batch file that will close rview.exe and RadianceIV.exe?
On an unrelated note I was able to use a batch file automatically open and run an M file in matlab, but I would also like to open and run a vbscript in another program called rhino. Is there a standard way to do this?
Thank you very much for any help
@ECHO OFF
@REM ===========================================
@REM By: Autodesk Ecotect Analysis 2010
@REM ===========================================
@ECHO ECO2RAD: SETTING UP ENVIRONMENT VARIABLES...
@REM ===========================================
SET RAYPATH=.;C:\Radiance\LIB
PATH=C:\Radiance\BIN;C:\Program Files\Autodesk\Ecotect Analysis 2010;$PATH
SET DOS4G=QUIET
@REM ===========================================
@ECHO ECO2RAD: DELETING AMBIENT AND OCTREE FILES...
@REM ===========================================
IF EXIST test_grid(3).oct DEL test_grid(3).oct
IF EXIST test_grid(3).amb DEL test_grid(3).amb
IF EXIST test_grid(3)*.pic DEL test_grid(3)*.pic
IF EXIST test_grid(3).ok DEL test_grid(3).ok
@REM ===========================================
@ECHO ECO2RAD: RUNNING RADIANCE TO GENERATE VIEWS...
@REM ===========================================
RAD -o SVGA test_grid(3).rif
@REM ===========================================
@ECHO ECO2RAD: CALCULATING GRID POINTS...
@ECHO WARNING: THIS COULD TAKE QUITE A WHILE...
@REM ===========================================
rtrace -I -h -dp 2048 -ar 32 -ms 0.063 -ds .2 -dt .05 -dc .75 -dr 3 -sj 1 -st
.01 -ab 8 -aa .1 -ad 512 -as 256 -av 0.01 0.01 0.01 -lr 12 -lw .0005 -af
CAL.amb test_grid(3).oct < test_grid(3).pts > test_grid(3).dat
@RENAME test_grid(3).dat test_grid(3).ok
@ECHO ECO2RAD: GRID POINTS COMPLETE.
@REM ===========================================
@ECHO ECO2RAD: LAUNCHING IMAGE VIEWER...
@REM ===========================================
RadianceIV .\test_grid(3)*.pic
@ECHO ECO2RAD: DONE!
The program launches an image viewer called WINVIEW (rview.exe) which I have to manually close. Once I close the viewer it launches a Radiance Image Viewer (RadianceIV.exe) and gives me the output ascii formatted .OK file.
All I want is the .OK file. This is part of an automatic process that has to happen thousands of times. Can I add any lines to the batch file that will close rview.exe and RadianceIV.exe?
On an unrelated note I was able to use a batch file automatically open and run an M file in matlab, but I would also like to open and run a vbscript in another program called rhino. Is there a standard way to do this?
Thank you very much for any help