How to run a VBA Macro on Autocad

How to run a VBA Macro on Autocad

Anonymous
Not applicable
515 Views
4 Replies
Message 1 of 5

How to run a VBA Macro on Autocad

Anonymous
Not applicable
How can I run or call a command that I made in VBA by typing its name on command line or pushing an icon on the menu bar ?I know that i can use VBAIDE,VBARUN,...,but I need to run my VBA like I am using COPY command (for example). Thanks, Afshin.
0 Likes
516 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
"A-Design" wrote in message news:4166e1d4$1_3@newsprd01... > How can I run or call a command that I made in VBA by typing its name on > command line or pushing an icon on the menu bar ?I know that i can use > VBAIDE,VBARUN,...,but I need to run my VBA like I am using COPY command (for > example). Thanks, I have a lisp routine that defines several macros to commands. A sample: (defun RunVbaMacro ( sFileName sMacroName / fnam fullname) (if (setq fullname (findfile sFileName)) (progn (vl-vbaload fullname) (vl-vbarun sMacroName) (command "vbaunload" sFileName) );progn (alert (strcat sFileName " cannot be located!\nGive IT Dept this file name!")) );if );defun (defun C:STH ( / ) (RunVbaMacro "DimensionTextControl.dvb" "DimensionTextControl.dvb!mUserMacros.ShowTextSettings") (princ) ) (defun C:LAG ( / ) (RunVbaMacro "CecLayerTools.dvb" "CecLayerTools.dvb!mUserMacros.LayerGroups") (princ) ) The result of the two listed are commands STH and LAG, which can be issued at the command prompt.
0 Likes
Message 3 of 5

Anonymous
Not applicable
Check out www.caddzone.com & look for a lisp routine called autovbaload.lsp it is similar to autoload for lisp but will load and run vba macros
0 Likes
Message 4 of 5

Anonymous
Not applicable
Hi, You may care to look at my post in the Land Desktop Customisation Group under "Civil Desktop not loaded" on 8 Oct. -- Laurie Comerford CADApps www.cadapps.com.au "A-Design" wrote in message news:4166e1d4$1_3@newsprd01... > How can I run or call a command that I made in VBA by typing its name on > command line or pushing an icon on the menu bar ?I know that i can use > VBAIDE,VBARUN,...,but I need to run my VBA like I am using COPY command (for > example). Thanks, > > Afshin. > >
0 Likes
Message 5 of 5

Anonymous
Not applicable
Thanks for the responses "Laurie Comerford" wrote in message news:4166fbbd_1@newsprd01... > Hi, > > You may care to look at my post in the Land Desktop Customisation Group > under "Civil Desktop not loaded" on 8 Oct. > > -- > > > Laurie Comerford > CADApps > www.cadapps.com.au > > "A-Design" wrote in message > news:4166e1d4$1_3@newsprd01... > > How can I run or call a command that I made in VBA by typing its name on > > command line or pushing an icon on the menu bar ?I know that i can use > > VBAIDE,VBARUN,...,but I need to run my VBA like I am using COPY command > (for > > example). Thanks, > > > > Afshin. > > > > > >
0 Likes