Running macro from command line

Running macro from command line

Anonymous
Not applicable
242 Views
1 Reply
Message 1 of 2

Running macro from command line

Anonymous
Not applicable
Hi

I am trying to run a macro from the command menu by using a short cut key,
eg "AT", similar to running a Lisp program.

I know I can load and run macros by using the VBALoad and VBARun commands.

Do I need to edit my acad.pgp or acad.mnu and do I need to add the macro to
my AutoStart.

Regards

Steven Houghton
0 Likes
243 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Hello Steven

1. If you name the macro file acad.vba, an place it in the searchpath, it is
automatically loaded.
2. To my opinion, the easiest way to run the macro, is through lisp!

Sample:
I have a VBA-macro called SaveOwnCmd, which I can call from the commandline
as msave.
Place the lisp in acad.lsp

(defun c:msave ()
(setq old_CMDECHO (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
;
(command "-vbarun" "saveownCmd")
;
(setvar "CMDECHO" old_CMDECHO)
(princ)
)

"Steven Houghton" wrote in message
news:0BE8AFF96491F2DE9B00FEE6FD0794F6@in.WebX.maYIadrTaRb...
> Hi
>
> I am trying to run a macro from the command menu by using a short cut key,
> eg "AT", similar to running a Lisp program.
>
> I know I can load and run macros by using the VBALoad and VBARun commands.
>
> Do I need to edit my acad.pgp or acad.mnu and do I need to add the macro
to
> my AutoStart.
>
> Regards
>
> Steven Houghton
>
0 Likes