I have created script files to generate a complex shape in AutoCad from an excel file. Each .SCR file is unique. What I want to do is create a separate AutoCad file for each unique .SCR file (there are over 100 .scr files). Note that I do not want to run the same script on multiple files as is commonly done.
I was thinking I could use a lisp routine to iterate through a list (.txt?) with the .SCR file names. For each .scr file in the list it would open a new .dwg file, run the script, do a few simple operations, save and close the file.
I have no lisp experience but have some R and Matlab programming background.
First: Is this possible?
Second: Do you have any coding suggestions?
Something like below is what I was thinking, excuse my abuse of syntax, I am a newbie.
list=list.txt with .SCR file names
Command: (foreach entry list ;;list is a list of file names ex("Tree108.scr" "Tree205.scr" Tree356.scr")
(setq ent(vl-string-right-trim ".scr" "entry")) ; trim scr from current list element, I think, store as ent
(Command: open "c:\\my documents\\ent.dwg" "w") ;; ent is entry - .scr
(Command: Filedia 0) ;;suppresses file dialogue box
(Command: SCRIPT entry) ;; entry is the file name (ex."Tree120.scr")
(Command: _-view front) ;; view from front
(Command: zoom extents) ;; get all of tree in view
(Command: Saveas "" ent) ;;save as, then "" for default?, then entry
(Command: Close) ;;Close file, repeat for next enrty
) ;;end of foreach loop