WashCaps37 Posted March 16, 2005 Posted March 16, 2005 Hello All - I am new to this scripting so please forgive me. I am trying create a script that will eventually run an AutoCAD Script file but I keep running into an AutoIT Error message that states: Unable to execute the external program. The system cannot find the path specified. I have the correct path in the *au3 file. Does anyone know what I am doing wrong on this line of the script? (see below) run("L:\\Cad_Library\Bonus_Tools\Scripts\Cycle Layouts.scr") Any and all help is greatly appreciated!
Andre Posted March 16, 2005 Posted March 16, 2005 hi, as far as i know can Run only work with .exe .cmd .bat files......... Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
phillip123adams Posted March 16, 2005 Posted March 16, 2005 Hello All - I am new to this scripting so please forgive me. I am trying create a script that will eventually run an AutoCAD Script file but I keep running into an AutoIT Error message that states: Unable to execute the external program. The system cannot find the path specified. I have the correct path in the *au3 file. Does anyone know what I am doing wrong on this line of the script? (see below)run("L:\\Cad_Library\Bonus_Tools\Scripts\Cycle Layouts.scr")Any and all help is greatly appreciated!<{POST_SNAPBACK}>AutoCAD Scripts run only from within AutoCAD or on the command line for AutoCAD. Within AutoCAD, use the SCRIPT command, or run it using AutoLisp by issuing the following on the AutoCAD command line or from within an AutoLisp file (double backslashes for all backslashes).(command "script" "L:\\Cad_Library\\Bonus_Tools\\Scripts\\Cycle Layouts.scr") Phillip
WashCaps37 Posted March 16, 2005 Author Posted March 16, 2005 (edited) Do you have any suggestions/ideas on how I would be able to get this to work (execute the *.scr file) from a *.au3 script file? Edited March 16, 2005 by WashCaps37
WashCaps37 Posted March 16, 2005 Author Posted March 16, 2005 I guess I could convert it to an AutoLISP and try and execute it from the *au3 file. Would the "Send" command work in this case?
phillip123adams Posted March 16, 2005 Posted March 16, 2005 Do you have any suggestions/ideas on how I would be able to get this to work (execute the *.scr file) from a *.au3 script file?<{POST_SNAPBACK}>As this is a topic chiefly about AutoCAD, this is not the proper forum. Since it is also about the AutoIt Run function, it probably belongs in the "v3 Support" forum. If you need additional help, you should repost there, or in the Chat forum, or you could PM me.Do you mean you want to start AutoCAD and have it immediately run a script? If so, add the /b option to the AutoCAD command line (the Target in the AutoCAD icon). For example to run AutoCAD and the AutoCAD script from an AutoIT3 script, do the following (Use single backslashes on the command line and note the use of single and double quotes):Run('"C:\Program Files\AutoCad 2005\acad.exe" /b "L:\Cad_Library\Bonus_Tools\Scripts\Cycle Layouts.scr"')There may be other switches on your command line. If so, keep them and add the /b switch to the end.From the AutoCAD help file (search for /B):The /b switch designates a script to run after AutoCAD starts. To invoke a script when you start AutoCAD, use the following syntax: acad [drawing file]/b script The script file must be listed after the /b switch on the command line; an SCR file type is assumed. If AutoCAD can't find the script file, it reports that it can't open the file. Scripts can be used to set up drawing parameters in a new drawing file. For example, the following command creates a new drawing called widget and runs the script called setup.scr: acad widget /b setup When the script has finished, the Command prompt is displayed. You must be very familiar with the sequence of AutoCAD prompts to provide an appropriate sequence of responses in a script file. Note: AutoCAD prompts and command names may change in future releases, so you may need to revise your scripts when you upgrade. It is recommended that you avoid using abbreviations. Phillip
fi3l2 Posted March 18, 2005 Posted March 18, 2005 there is a way to run an .au3 script with another script instead of using the Run() function make the script goto start , run, enter in the path, then press enter it works for me example Send("#r") WinWaitActive("Run") Send($program & "{Enter}") this works for me, hopefully it will help you
WashCaps37 Posted March 18, 2005 Author Posted March 18, 2005 Thanks fi3l2! I'll give it a try when I get an opportunity.
WashCaps37 Posted March 18, 2005 Author Posted March 18, 2005 Thanks phillip! I'll give it a try when I get a free moment. I'll PM you or repost in the Support Forum if I need any additional help. This was my first post and I didn't know if this was the right forum to post my question, so I apologize for the mix up. Thanks again!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now