ajwojeck Posted April 13, 2010 Posted April 13, 2010 I've used Autolisp to save data in a text file that was processed by a DOS based executable which output processed info into another text file. This worked well in R14 but now I'm using Acad 2007 and these files may end up ina document folder or elsewhere. I've tried specifying where the should go or be found but this doesn't always work as expected. This might work better in VBA or some using some vl-function (neither of which I've used yet). Any ideas? Quote
alanjt Posted April 13, 2010 Posted April 13, 2010 This should help... http://www.cadtutor.net/forum/showpost.php?p=271366&postcount=11 eg. (AT:WriteToFile "C:\\test.txt" '("line 1" "line 2" "line 3") t) Quote
ajwojeck Posted April 15, 2010 Author Posted April 15, 2010 I have no trouble wrighting to a text file. The program then calls a DOS hell to run the executable which outputs another text(result) file. Depending on how AutoCAD was started or how a file was open the program looks in the wrong place e.g. My Documents I have even used the findfile function without much success. Quote
alanjt Posted April 15, 2010 Posted April 15, 2010 Hmm, I'm a little lost. Without more information, I'm not sure how much I can help. If all the DOS shell does is create a secondary file to run, you could easily do this with some LISP. Quote
alanjt Posted April 15, 2010 Posted April 15, 2010 That's DOS shell I think you had it right the first time. :wink: Just kidding, I loved DOS when I was a kid. Quote
ajwojeck Posted April 15, 2010 Author Posted April 15, 2010 The first text file is used as such: Dosfile.exe Firstfile.txt contains desired location and name for new file e.g. C:\MyResults\Secondfile.txt When the lisp program looks for the file it's not there. My current thoughts: it's been put elsewhere or ACAD can't find Dosfile.exe There must be an easier way Quote
The Buzzard Posted April 15, 2010 Posted April 15, 2010 I've used Autolisp to save data in a text file that was processed by a DOS based executable which output processed info into another text file. This worked well in R14 but now I'm using Acad 2007 and these files may end up ina document folder or elsewhere. I've tried specifying where the should go or be found but this doesn't always work as expected. This might work better in VBA or some using some vl-function (neither of which I've used yet). Any ideas? You can type SHELL at the command line to get a dos prompt. Quote
ajwojeck Posted April 15, 2010 Author Posted April 15, 2010 Thanks guys, in the end I put in the full path to the dot EXE file even though it is supposed to be in the ACAD search path. This seems to work. A lot of this problem stems from the way Microsoft requires developers to place files for their applications. It was a lot easier prior to the 2005 release. To all who replied, I appreciated your feedbacks. AJ Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.