TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: CECE_CAD on January 15, 2007, 10:56:58 AM

Title: LOADING SCRIPT WITH COMMANDS
Post by: CECE_CAD on January 15, 2007, 10:56:58 AM
I have a script for our company standard layers that I want all users to use easily.  I’m trying to load it by a command.  I have tried to get it load with this command:

(DEFUN C:asd () (COMMAND "SCRIPT" "K:/Settings/e_proto.scr" ""))

Also I have tried to do it this way: ^C^C-script;k:/settings/e-proto.scr;

For some reason it’s not loading...?  The script loads fine when loading thru the script dialog. 

I'm using AutoCAD 2007 Any suggestions?
Title: Re: LOADING SCRIPT WITH COMMANDS
Post by: Dommy2Hotty on January 15, 2007, 11:19:17 AM
Try:
^C^C-script;"k:/settings/e-proto.scr";
Title: Re: LOADING SCRIPT WITH COMMANDS
Post by: Dommy2Hotty on January 15, 2007, 11:21:23 AM
I tested it using command and the following works for me:

(command "script" "//d22/Dominic/AutoCAD_Custom/scripts/alert.SCR")

So this should work for you:

(DEFUN C:asd () (COMMAND "SCRIPT" "K:/Settings/e_proto.scr"))
Title: Re: LOADING SCRIPT WITH COMMANDS
Post by: CECE_CAD on January 15, 2007, 11:44:40 AM
when I use that i get this back


Command: asd SCRIPT
Enter script file name <J:\Drawing2.scr>:
"Drawing2.scr": Can't find file.

Command: K:/Settings/e_proto.scr Unknown command "K:/SETTINGS/E_PROTO.SCR". 
Press F1 for help.

Command: nil
Title: Re: LOADING SCRIPT WITH COMMANDS
Post by: Keith™ on January 15, 2007, 11:48:39 AM
check the spelling of the script name
Title: Re: LOADING SCRIPT WITH COMMANDS
Post by: CECE_CAD on January 15, 2007, 11:54:47 AM
when I put this in the command line: (COMMAND "SCRIPT" "K:/Settings/e_proto.scr") the script loads fine.........? its a little aggervating :|
Title: Re: LOADING SCRIPT WITH COMMANDS
Post by: Keith™ on January 15, 2007, 12:03:57 PM
try changing the command portion to vl-cmdf as such:

Code: [Select]
(defun C:ASD ()
 (vl-cmdf "-script" "K:/Settings/e_proto.scr")
)
Title: Re: LOADING SCRIPT WITH COMMANDS
Post by: CECE_CAD on January 15, 2007, 01:00:04 PM
its wierd because I got a strange warning this morning after I installed the CAD Manager tool on my station.  The message was telling me to reinstall CAD to make sure all features are working properly.  That might be messing this up, I'm going to try a few things and I will let you know what happens
Title: Re: LOADING SCRIPT WITH COMMANDS
Post by: CECE_CAD on January 15, 2007, 02:26:56 PM
the last one worked after i reinstalled, but I change one thing.  you had "-script" it didn't like that so i did underscore.  Thanks for the help, much appreciated!

(defun C:dsa ()
 (vl-cmdf "_script" "K:/Settings/e_proto.scr")
)