Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VBA routine

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
292 Views, 5 Replies

VBA routine

I have a VBA routine that I received from a customer to use to create
glass sizes on curtain wall elevations. They have several inhouse menus
loaded when they start Acad that obviously give the VBA routine a start
command of GS at the command line. I of course don't have all of their
customization loaded so GS does not work for me. I know nothing about
VBA code and am wondering if there is a way to start the code without
whatever creates the keyboard shortcut? I'd have to get their permission
to post the code if that's what it takes
thanks,
Dave
DDP
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

Tools>Macro>Macros ...

Pick one from the list and click run.

If you're lucky there will only be one macro to pick from. If there is more
than one, start with the one who's name makes the most sense.

HTH
Message 3 of 6
Anonymous
in reply to: Anonymous

Hi,

After following Gary's advice and finding the Macro name to run the command,
define a command GS by adding the following to one of your automatically
loading lisp files.

(Function C:GS ()
(VL-LOAD-COM)
(VL-VBARUN "Filename.DVB!MacroName")
)


--

Laurie Comerford
CADApps
www.cadapps.com.au
www.civil3Dtools.com
"Gary McMaster" wrote in message
news:5699357@discussion.autodesk.com...
Tools>Macro>Macros ...

Pick one from the list and click run.

If you're lucky there will only be one macro to pick from. If there is more
than one, start with the one who's name makes the most sense.

HTH
Message 4 of 6
Anonymous
in reply to: Anonymous

Laurie Comerford wrote:
> Hi,
>
> After following Gary's advice and finding the Macro name to run the command,
> define a command GS by adding the following to one of your automatically
> loading lisp files.
>
> (Function C:GS ()
> (VL-LOAD-COM)
> (VL-VBARUN "Filename.DVB!MacroName")
> )
>
>

thanks for the help! I'm getting a syntax error when running the above code

Command: (Function C:GS ()
(_> (VL-LOAD-COM)
(_> (VL-VBARUN "GlassSizer.dvb!basGlassSize.GlassSize")
(_> )

Error: syntax error

I'd also like to autoload the .dvb file. Would this work if added to the
above?

(VL-VBALOAD "GlassSizer.dvb")
Dave
DDP
Message 5 of 6
Anonymous
in reply to: Anonymous

Hi Dave,

The VL-VBARUN command checks if the program file is loaded and loads it if
necessary.

Hence the VL-VBALOAD function is not necessary.

The syntax looks OK. Unless you have more than one "GlassSize" sub in the
program try

(VL-VBARUN "GlassSizer.dvb!GlassSize") from the command line.

This assumes the GlassSizer.dvb program is in the AutoCAD search path.
Otherwise you need to add a path string to allow the file to be found.

--

Laurie Comerford
CADApps
www.cadapps.com.au
www.civil3Dtools.com


"ddpcad" wrote in message
news:5699398@discussion.autodesk.com...
Laurie Comerford wrote:
> Hi,
>
> After following Gary's advice and finding the Macro name to run the
> command,
> define a command GS by adding the following to one of your automatically
> loading lisp files.
>
> (Function C:GS ()
> (VL-LOAD-COM)
> (VL-VBARUN "Filename.DVB!MacroName")
> )
>
>

thanks for the help! I'm getting a syntax error when running the above code

Command: (Function C:GS ()
(_> (VL-LOAD-COM)
(_> (VL-VBARUN "GlassSizer.dvb!basGlassSize.GlassSize")
(_> )

Error: syntax error

I'd also like to autoload the .dvb file. Would this work if added to the
above?

(VL-VBALOAD "GlassSizer.dvb")
Dave
DDP
Message 6 of 6
Anonymous
in reply to: Anonymous

Laurie Comerford wrote:
> Hi Dave,
>
> The VL-VBARUN command checks if the program file is loaded and loads it if
> necessary.
>
> Hence the VL-VBALOAD function is not necessary.
>
> The syntax looks OK. Unless you have more than one "GlassSize" sub in the
> program try
>
> (VL-VBARUN "GlassSizer.dvb!GlassSize") from the command line.
>
> This assumes the GlassSizer.dvb program is in the AutoCAD search path.
> Otherwise you need to add a path string to allow the file to be found.
>

Thanks Miss VBA Wiz! 🙂 the macro name should have been !GlassSize not
!GlassSize.Glasssize. Works now
Dave
DDP
ps: thanks to Gary for his input also!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost