I have a batch program which I want to launch from a LISP program.
First this is an attempt at an automated process whereby user input is extremely restricted. Other than the first click of the mouse on the menu item to save a copy of the file to a very restricted folder, no other user input is allowed.
AutoCAD, like most commercial apps writes a temporary file and then renames it when you choose save or saveas. And due to the restrictions in this folder that will not work. Crazy, I know but it's the parameters I must work within.
The batch file I'm launching calls another batch program in it's execution and I'm wondering if that could be where control is lost. But the thing is I can type this at the command line in AutoCAD:
The whole process works great. The command window flashes briefly AutoCAD closes the active drawing window just like I want it to. And when I check that the dwg file has been copied to the restricted folder it's there and done. But when I place that same command within my LISP program or one like this:
(command "._STARTAPP" "CMD //a_very_long/novell_server_path/my_folder/vlisp/m
ybatchfile.bat") or (command "._STARTAPP" "CMD "\"//a_very_long/novell_server_path/my_folder/vlis p/mybatchfile.bat\"")
or just about anything else I try it fails to run. Perhaps I've been looking at this problem too long. I think I may move on to a VB.NET process to do this but I am really baffled why it will run from the command line but not within the program.
That (startapp ...) call should work in an AutoLISP program, if it is the last thing you do.
Autolisp environment is separate for each drawing, so if your batch file closes the active AutoCAD window, the running Lisp program is lost.
Thanks but the batch file doesn't shutdown anything. It only works on some text files and then makes a copy of the file which my lisp file created in the temporary location of C:\TEMP. I want to actually move the file instead of copying it but until I get the bugs worked out of this I will not take any chances that something might get erased before the copy is made. Call me paranoid at this point.
I have no less than three other LISP programs which do this and they all work fine. It's only this one LISP file which works with this restricted folder where the close command whacks AutoCAD upside the head. And at the time the close command is run the Active drawing is actually in the C:\TEMP folder so there should not be any problem with rights.
(command "._SAVEAS" "2004" "//path/folder/dwgname.dwg") (command "._CLOSE")
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register