Author Topic: LOADING SCRIPT WITH COMMANDS  (Read 2162 times)

0 Members and 1 Guest are viewing this topic.

CECE_CAD

  • Guest
LOADING SCRIPT WITH COMMANDS
« 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?
« Last Edit: January 15, 2007, 10:58:28 AM by CECE_CAD »

Dommy2Hotty

  • Swamp Rat
  • Posts: 1127
Re: LOADING SCRIPT WITH COMMANDS
« Reply #1 on: January 15, 2007, 11:19:17 AM »
Try:
^C^C-script;"k:/settings/e-proto.scr";

Dommy2Hotty

  • Swamp Rat
  • Posts: 1127
Re: LOADING SCRIPT WITH COMMANDS
« Reply #2 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"))

CECE_CAD

  • Guest
Re: LOADING SCRIPT WITH COMMANDS
« Reply #3 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

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: LOADING SCRIPT WITH COMMANDS
« Reply #4 on: January 15, 2007, 11:48:39 AM »
check the spelling of the script name
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CECE_CAD

  • Guest
Re: LOADING SCRIPT WITH COMMANDS
« Reply #5 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 :|

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: LOADING SCRIPT WITH COMMANDS
« Reply #6 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")
)
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CECE_CAD

  • Guest
Re: LOADING SCRIPT WITH COMMANDS
« Reply #7 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

CECE_CAD

  • Guest
Re: LOADING SCRIPT WITH COMMANDS
« Reply #8 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")
)