View Full Version : COMMAND LINES operation within VBA

2004-11-29, 07:35 AM
In R-2005 they said at CAMP-CAD (Jax) that you could write VBA code that would act exactly as IF you typed the functions on the COMMAND LINE... I have looked everywhere... NOTHING...

Ed Jobe
2004-11-29, 05:24 PM
Perhaps you heard incorrectly. Not vba, but vb.net. You can get vba to act as a command if you write a lisp function to act as a command wrapper. There should be some examples in this forum if you search for (vla-vbarun).

2004-11-29, 08:40 PM
BUT I did hear them say that distinkly... in the Cad-Camp meeting (Jax)...
HOW you exicute functions in the command line (Polygons) from VBA is NOT found yet...
I will try to find some more info on VBARUN
Also I am extremely interested in the VBA classes on ATP...
I also have some lessons that could help... solid geometry & trigometry 3D objects... ...

Ed Jobe
2004-11-29, 09:28 PM
Not sure what you heard or understood, but vba6 cannot be run directly as a command. The usual process is to write a vba procedure. It has to be a public procedure with no arguments. Then you write a lisp wrapper for it, e.g. if your macro is called MyMacro then you would write a lisp called (c:MyMacro) that calls your macro. Then you load this lisp at startup, usually via acad.lsp or a menu.lsp. In 2005, the ability to access the command stack has been added to .NET apps, but not vba.

2004-11-30, 07:16 AM
If you make a commandbutton to execute your vba, and then assign a shortcut key to that you can run your vba from the commandline.
Or is that way far off....?

Best regards

2004-12-02, 07:23 PM
Are you looking for vbastmt?

This allows you to run VBA at the command line:

Thisdrawing.application.activedocument.windowstate = acmin

2004-12-03, 06:53 PM
I believe you are looking for SendCommand.