We use something like this
(defun C:RunMyVBA ()
(vl-vbarun "YourVBAProgram.dvb!vbaname.modulename.macroname")
(princ)
);end function "RunMyVBA"
This will autoload your macro as long as it is in your path and allow
you to just hit return to rerun the macro. the other way will work but
will only reissue the "-vbarun" command and not your program.
--
David Urban, P.E.
Project Engineer
Pape-Dawson Huffcut Engineers, Inc.
7800 Shoal Creek Blvd. Suite 253 East
Austin, TX 78757
ph. 512-454-8711
fax 512-459-8867
cell 512-415-1971
durban@pape-dawson.com
Paul Richardson wrote:
> in addition does your vba code use SendCommand anywhere? that
> will end up being your last command..
> "Gary McMaster" wrote in message
> news:4883172@discussion.autodesk.com...
> bhl,
>
> Try putting your VBA load/run commands inside of a "lisp wrapper" to make
> them repeat.
>
> Put lisp code similar to that below into your "acaddoc.lsp" file. Create the
> "acaddoc.lsp" if you don't have one (see help)
>
> Change your tool button to run the new lisp function "RunMyVBA" (as shown
> below). The command should repeat (Acad 2004 or less) like any other native
> command.
>
> HTH,
>
> Gary
>
> (defun C:RunMyVBA ()
>
> (vl-vbaload "C:\\YourDirectory\\YourVBAProgram.dvb")
> (command "-vbarun" "YourMacroName")
> (princ)
>
> );end function "RunMyVBA"
--
David Urban, P.E.
Project Engineer
Pape-Dawson Huffcut Engineers, Inc.
7800 Shoal Creek Blvd. Suite 253 East
Austin, TX 78757
ph. 512-454-8711
fax 512-459-8867
cell 512-415-1971
durban@pape-dawson.com