John,
This one is a little tricky. You cannot send arguments to a macro, so
you have to fake it out a little and read the additional information from
the command line. Here is a little snippet from one of my apps to check a
discipline setting:
Dim strParam1 as string
Dim strDispDir as String
'Check the passed parameter to ensure a discipline setting
strParam1 = ThisDrawing.Utility.GetString(False)
If strParam1 = "" Then
MsgBox "You need to supply a discipline parameter."
Else
strDispDir = "G:\dept\acad\" & strParam1
End If
The GetString method is the important one. If the argument(s) that you are
passing contains spaces, you will need to use .GetString(True) and you will
need to end the string with a return. In my case, I am just sending a single
word. . You can also add a prompt after the "True" or "False".
I then have a menu setup for the different disciplines like so:
^C^C-vbarun g:/cad/acad2000/macros/mymacro.dvb!Checkdisp Arch
This calls the Sub 'Checkdisp' from the mymacro.dvb and sends "Arch" as an
argument.
Rich Tiede
CAD Manager/Developer
Sear-Brown
"jmartens" wrote in message
news:f11a568.-1@WebX.maYIadrTaRb...
I want to run a sub procedure and pass it a couple of argumnents from the
command line or new toolbar button.
Is this possible? Any workarounds?
Any help is appreciated!
Thanks!
John M.