<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337861#M85438</link>
    <description>I have the buttons in Acad setup with the following syntax:&lt;BR /&gt;
&lt;BR /&gt;
^C^C-vbarun gatevalve        or&lt;BR /&gt;
^C^C-vbarun ovalve             etc.&lt;BR /&gt;
&lt;BR /&gt;
Using this method I need to have a sub for each button to call individually.&lt;BR /&gt;
If I could place the block name (gatevalve, ovalve...) and the size in the&lt;BR /&gt;
button I could call the controller function directly (after changing it to a&lt;BR /&gt;
sub)  Hope this explains what I am after.&lt;BR /&gt;
&lt;BR /&gt;
Sub Gatevalve()&lt;BR /&gt;
    BoGus = Controller("Gatevalve", 1)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Sub Ovalve()&lt;BR /&gt;
    BoGus = Controller("Ovalve", 1)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Function Controller(BlockName, SiZe)&lt;BR /&gt;
&lt;BR /&gt;
    BoGus = IsLocalBlock(BlockName)&lt;BR /&gt;
    BoGus = LinearInSerter(BlockName, SiZe)&lt;BR /&gt;
&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
Thanks for sharing your knowledge.&lt;BR /&gt;
Ross&lt;BR /&gt;
&lt;BR /&gt;
"Frank Oquendo" &lt;FRANKO&gt; wrote in message&lt;BR /&gt;
news:7AF37832A331553C580ACC0E3735133A@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; We'll need more information and some code, if you got it.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; http://www.acadx.com&lt;BR /&gt;
&amp;gt; Win an autographed copy of&lt;BR /&gt;
&amp;gt; "Mastering AutoCAD 2000 Objects"&lt;BR /&gt;
&amp;gt; by Dietmar Rudolph&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Ross Tanner" &lt;RTANNER&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:6257A5D0974FDDF7F4FED957C760D65C@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; I have a standard function that I would like to use several times over&lt;BR /&gt;
&amp;gt; &amp;gt; feeding it a different value on each execution.  I don't think this is&lt;BR /&gt;
&amp;gt; &amp;gt; possible but hey! I have been wrong before. The tool is designed to&lt;BR /&gt;
insert&lt;BR /&gt;
&amp;gt; &amp;gt; blocks and break the lines around them.  Thanks for any help...&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Ross&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/RTANNER&gt;&lt;/FRANKO&gt;</description>
    <pubDate>Tue, 10 Apr 2001 08:24:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2001-04-10T08:24:04Z</dc:date>
    <item>
      <title>Options when calling a function from a button within acad?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337858#M85435</link>
      <description>I have a standard function that I would like to use several times over&lt;BR /&gt;
feeding it a different value on each execution.  I don't think this is&lt;BR /&gt;
possible but hey! I have been wrong before. The tool is designed to insert&lt;BR /&gt;
blocks and break the lines around them.  Thanks for any help...&lt;BR /&gt;
&lt;BR /&gt;
Ross</description>
      <pubDate>Mon, 09 Apr 2001 13:38:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337858#M85435</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-04-09T13:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: Options when calling a function from a button within acad?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337859#M85436</link>
      <description>Where does the different value come from? You could put a wrapper routine&lt;BR /&gt;
around it, and call the function using the input as a passed variable.&lt;BR /&gt;
&lt;BR /&gt;
"Ross Tanner" &lt;RTANNER&gt; wrote in message&lt;BR /&gt;
news:6257A5D0974FDDF7F4FED957C760D65C@in.WebX.maYIadrTaRb...&lt;BR /&gt;
I have a standard function that I would like to use several times over&lt;BR /&gt;
feeding it a different value on each execution.  I don't think this is&lt;BR /&gt;
possible but hey! I have been wrong before. The tool is designed to insert&lt;BR /&gt;
blocks and break the lines around them.  Thanks for any help...&lt;BR /&gt;
&lt;BR /&gt;
Ross&lt;/RTANNER&gt;</description>
      <pubDate>Mon, 09 Apr 2001 17:41:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337859#M85436</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-04-09T17:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Options when calling a function from a button within acad?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337860#M85437</link>
      <description>We'll need more information and some code, if you got it.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
http://www.acadx.com&lt;BR /&gt;
Win an autographed copy of&lt;BR /&gt;
"Mastering AutoCAD 2000 Objects"&lt;BR /&gt;
by Dietmar Rudolph&lt;BR /&gt;
&lt;BR /&gt;
"Ross Tanner" &lt;RTANNER&gt; wrote in message&lt;BR /&gt;
news:6257A5D0974FDDF7F4FED957C760D65C@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; I have a standard function that I would like to use several times over&lt;BR /&gt;
&amp;gt; feeding it a different value on each execution.  I don't think this is&lt;BR /&gt;
&amp;gt; possible but hey! I have been wrong before. The tool is designed to insert&lt;BR /&gt;
&amp;gt; blocks and break the lines around them.  Thanks for any help...&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Ross&lt;BR /&gt;
&amp;gt;&lt;/RTANNER&gt;</description>
      <pubDate>Tue, 10 Apr 2001 06:44:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337860#M85437</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-04-10T06:44:43Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337861#M85438</link>
      <description>I have the buttons in Acad setup with the following syntax:&lt;BR /&gt;
&lt;BR /&gt;
^C^C-vbarun gatevalve        or&lt;BR /&gt;
^C^C-vbarun ovalve             etc.&lt;BR /&gt;
&lt;BR /&gt;
Using this method I need to have a sub for each button to call individually.&lt;BR /&gt;
If I could place the block name (gatevalve, ovalve...) and the size in the&lt;BR /&gt;
button I could call the controller function directly (after changing it to a&lt;BR /&gt;
sub)  Hope this explains what I am after.&lt;BR /&gt;
&lt;BR /&gt;
Sub Gatevalve()&lt;BR /&gt;
    BoGus = Controller("Gatevalve", 1)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Sub Ovalve()&lt;BR /&gt;
    BoGus = Controller("Ovalve", 1)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Function Controller(BlockName, SiZe)&lt;BR /&gt;
&lt;BR /&gt;
    BoGus = IsLocalBlock(BlockName)&lt;BR /&gt;
    BoGus = LinearInSerter(BlockName, SiZe)&lt;BR /&gt;
&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
Thanks for sharing your knowledge.&lt;BR /&gt;
Ross&lt;BR /&gt;
&lt;BR /&gt;
"Frank Oquendo" &lt;FRANKO&gt; wrote in message&lt;BR /&gt;
news:7AF37832A331553C580ACC0E3735133A@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; We'll need more information and some code, if you got it.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; http://www.acadx.com&lt;BR /&gt;
&amp;gt; Win an autographed copy of&lt;BR /&gt;
&amp;gt; "Mastering AutoCAD 2000 Objects"&lt;BR /&gt;
&amp;gt; by Dietmar Rudolph&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Ross Tanner" &lt;RTANNER&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:6257A5D0974FDDF7F4FED957C760D65C@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; I have a standard function that I would like to use several times over&lt;BR /&gt;
&amp;gt; &amp;gt; feeding it a different value on each execution.  I don't think this is&lt;BR /&gt;
&amp;gt; &amp;gt; possible but hey! I have been wrong before. The tool is designed to&lt;BR /&gt;
insert&lt;BR /&gt;
&amp;gt; &amp;gt; blocks and break the lines around them.  Thanks for any help...&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Ross&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/RTANNER&gt;&lt;/FRANKO&gt;</description>
      <pubDate>Tue, 10 Apr 2001 08:24:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337861#M85438</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-04-10T08:24:04Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337862#M85439</link>
      <description>Ross, vba macros cannot contain arguments. Here is a workaround you can use,&lt;BR /&gt;
I'm sure there are others as well. You need a simple lisp routine and it&lt;BR /&gt;
works great...&lt;BR /&gt;
&lt;BR /&gt;
Sub GetArgument()&lt;BR /&gt;
  ''' THIS WOULD BE YOU "CONTROLLER FUNCTION"&lt;BR /&gt;
  MsgBox (AddFive(ActiveDocument.GetVariable("USERR1")))&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Private Function AddFive(iValue) As Double&lt;BR /&gt;
  ''' THIS WOULD BE THE FUNCTION TO DO YOU THING&lt;BR /&gt;
  AddFive = iValue + 5&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
now in your toolbar buttons you can do something like...&lt;BR /&gt;
&lt;BR /&gt;
(setvar "USERR1" 5)(princ) -vbarun GetArgument&lt;BR /&gt;
&lt;BR /&gt;
...the number 5 is the argument in this case. I would not reccomend using&lt;BR /&gt;
user vars though, I would use the registry or a text file to save your&lt;BR /&gt;
argument. If you make a lisp function to save the argument then you only&lt;BR /&gt;
need to do something like...&lt;BR /&gt;
&lt;BR /&gt;
(SaveArg 5) -vbarun GetArgument&lt;BR /&gt;
&lt;BR /&gt;
Tweak as you see fit.&lt;BR /&gt;
Best Reagrds,&lt;BR /&gt;
  Jacob Dinardi&lt;BR /&gt;
&lt;BR /&gt;
Ross Tanner &lt;RTANNER&gt; wrote in message&lt;BR /&gt;
news:89BF744AFFF2BDEC9935368F77D0FD35@in.WebX.maYIadrTaRb...&lt;BR /&gt;
I have the buttons in Acad setup with the following syntax:&lt;BR /&gt;
&lt;BR /&gt;
^C^C-vbarun gatevalve        or&lt;BR /&gt;
^C^C-vbarun ovalve             etc.&lt;BR /&gt;
&lt;BR /&gt;
Using this method I need to have a sub for each button to call individually.&lt;BR /&gt;
If I could place the block name (gatevalve, ovalve...) and the size in the&lt;BR /&gt;
button I could call the controller function directly (after changing it to a&lt;BR /&gt;
sub)  Hope this explains what I am after.&lt;BR /&gt;
&lt;BR /&gt;
Sub Gatevalve()&lt;BR /&gt;
    BoGus = Controller("Gatevalve", 1)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Sub Ovalve()&lt;BR /&gt;
    BoGus = Controller("Ovalve", 1)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Function Controller(BlockName, SiZe)&lt;BR /&gt;
&lt;BR /&gt;
    BoGus = IsLocalBlock(BlockName)&lt;BR /&gt;
    BoGus = LinearInSerter(BlockName, SiZe)&lt;BR /&gt;
&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
Thanks for sharing your knowledge.&lt;BR /&gt;
Ross&lt;BR /&gt;
&lt;BR /&gt;
"Frank Oquendo" &lt;FRANKO&gt; wrote in message&lt;BR /&gt;
news:7AF37832A331553C580ACC0E3735133A@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; We'll need more information and some code, if you got it.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; http://www.acadx.com&lt;BR /&gt;
&amp;gt; Win an autographed copy of&lt;BR /&gt;
&amp;gt; "Mastering AutoCAD 2000 Objects"&lt;BR /&gt;
&amp;gt; by Dietmar Rudolph&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Ross Tanner" &lt;RTANNER&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:6257A5D0974FDDF7F4FED957C760D65C@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; I have a standard function that I would like to use several times over&lt;BR /&gt;
&amp;gt; &amp;gt; feeding it a different value on each execution.  I don't think this is&lt;BR /&gt;
&amp;gt; &amp;gt; possible but hey! I have been wrong before. The tool is designed to&lt;BR /&gt;
insert&lt;BR /&gt;
&amp;gt; &amp;gt; blocks and break the lines around them.  Thanks for any help...&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Ross&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/RTANNER&gt;&lt;/FRANKO&gt;&lt;/RTANNER&gt;</description>
      <pubDate>Tue, 10 Apr 2001 08:37:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337862#M85439</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-04-10T08:37:03Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337863#M85440</link>
      <description>My favorite approach to that issue is one originally posted by Rakesh Rao:&lt;BR /&gt;
&lt;BR /&gt;
Public Sub MacroWithArguments()&lt;BR /&gt;
&lt;BR /&gt;
    Dim stringArg As String&lt;BR /&gt;
&lt;BR /&gt;
    stringArg = ThisDrawing.Utility.GetString(False)&lt;BR /&gt;
    MsgBox stringArg&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Replace the call to MsgBox with a call to your function and pass the function&lt;BR /&gt;
the argument you collected. As for your button macro, just include the argument&lt;BR /&gt;
right after the call to vbarun:&lt;BR /&gt;
&lt;BR /&gt;
^C^C^P-vbarun;MacroWithArguments;"gatevalve";&lt;BR /&gt;
^C^C^P-vbarun;MacroWithArguments;"ovalve";&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
http://www.acadx.com&lt;BR /&gt;
Win an autographed copy of&lt;BR /&gt;
"Mastering AutoCAD 2000 Objects"&lt;BR /&gt;
by Dietmar Rudolph&lt;BR /&gt;
&lt;BR /&gt;
"Ross Tanner" &lt;RTANNER&gt; wrote in message&lt;BR /&gt;
news:89BF744AFFF2BDEC9935368F77D0FD35@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; I have the buttons in Acad setup with the following syntax:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; ^C^C-vbarun gatevalve        or&lt;BR /&gt;
&amp;gt; ^C^C-vbarun ovalve             etc.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Using this method I need to have a sub for each button to call individually.&lt;BR /&gt;
&amp;gt; If I could place the block name (gatevalve, ovalve...) and the size in the&lt;BR /&gt;
&amp;gt; button I could call the controller function directly (after changing it to a&lt;BR /&gt;
&amp;gt; sub)  Hope this explains what I am after.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Sub Gatevalve()&lt;BR /&gt;
&amp;gt;     BoGus = Controller("Gatevalve", 1)&lt;BR /&gt;
&amp;gt; End Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Sub Ovalve()&lt;BR /&gt;
&amp;gt;     BoGus = Controller("Ovalve", 1)&lt;BR /&gt;
&amp;gt; End Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Function Controller(BlockName, SiZe)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     BoGus = IsLocalBlock(BlockName)&lt;BR /&gt;
&amp;gt;     BoGus = LinearInSerter(BlockName, SiZe)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; End Function&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanks for sharing your knowledge.&lt;BR /&gt;
&amp;gt; Ross&lt;/RTANNER&gt;</description>
      <pubDate>Tue, 10 Apr 2001 08:38:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337863#M85440</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-04-10T08:38:00Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337864#M85441</link>
      <description>That's a good one, I'll have to update some code &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Frank Oquendo &lt;FRANKO&gt; wrote in message&lt;BR /&gt;
news:0DC524619BD670D94F6BF1BC26674D2F@in.WebX.maYIadrTaRb...&lt;BR /&gt;
My favorite approach to that issue is one originally posted by Rakesh Rao:&lt;BR /&gt;
&lt;BR /&gt;
Public Sub MacroWithArguments()&lt;BR /&gt;
&lt;BR /&gt;
    Dim stringArg As String&lt;BR /&gt;
&lt;BR /&gt;
    stringArg = ThisDrawing.Utility.GetString(False)&lt;BR /&gt;
    MsgBox stringArg&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Replace the call to MsgBox with a call to your function and pass the&lt;BR /&gt;
function&lt;BR /&gt;
the argument you collected. As for your button macro, just include the&lt;BR /&gt;
argument&lt;BR /&gt;
right after the call to vbarun:&lt;BR /&gt;
&lt;BR /&gt;
^C^C^P-vbarun;MacroWithArguments;"gatevalve";&lt;BR /&gt;
^C^C^P-vbarun;MacroWithArguments;"ovalve";&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
http://www.acadx.com&lt;BR /&gt;
Win an autographed copy of&lt;BR /&gt;
"Mastering AutoCAD 2000 Objects"&lt;BR /&gt;
by Dietmar Rudolph&lt;BR /&gt;
&lt;BR /&gt;
"Ross Tanner" &lt;RTANNER&gt; wrote in message&lt;BR /&gt;
news:89BF744AFFF2BDEC9935368F77D0FD35@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; I have the buttons in Acad setup with the following syntax:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; ^C^C-vbarun gatevalve        or&lt;BR /&gt;
&amp;gt; ^C^C-vbarun ovalve             etc.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Using this method I need to have a sub for each button to call&lt;BR /&gt;
individually.&lt;BR /&gt;
&amp;gt; If I could place the block name (gatevalve, ovalve...) and the size in the&lt;BR /&gt;
&amp;gt; button I could call the controller function directly (after changing it to&lt;BR /&gt;
a&lt;BR /&gt;
&amp;gt; sub)  Hope this explains what I am after.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Sub Gatevalve()&lt;BR /&gt;
&amp;gt;     BoGus = Controller("Gatevalve", 1)&lt;BR /&gt;
&amp;gt; End Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Sub Ovalve()&lt;BR /&gt;
&amp;gt;     BoGus = Controller("Ovalve", 1)&lt;BR /&gt;
&amp;gt; End Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Function Controller(BlockName, SiZe)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     BoGus = IsLocalBlock(BlockName)&lt;BR /&gt;
&amp;gt;     BoGus = LinearInSerter(BlockName, SiZe)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; End Function&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanks for sharing your knowledge.&lt;BR /&gt;
&amp;gt; Ross&lt;/RTANNER&gt;&lt;/FRANKO&gt;</description>
      <pubDate>Tue, 10 Apr 2001 08:55:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337864#M85441</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-04-10T08:55:51Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337865#M85442</link>
      <description>Frank,&lt;BR /&gt;
&lt;BR /&gt;
That is fantastic!  I can/will use this in many places!&lt;BR /&gt;
&lt;BR /&gt;
Thanks abunch.&lt;BR /&gt;
Ross&lt;BR /&gt;
&lt;BR /&gt;
"Frank Oquendo" &lt;FRANKO&gt; wrote in message&lt;BR /&gt;
news:0DC524619BD670D94F6BF1BC26674D2F@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; My favorite approach to that issue is one originally posted by Rakesh Rao:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Public Sub MacroWithArguments()&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     Dim stringArg As String&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     stringArg = ThisDrawing.Utility.GetString(False)&lt;BR /&gt;
&amp;gt;     MsgBox stringArg&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; End Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Replace the call to MsgBox with a call to your function and pass the&lt;BR /&gt;
function&lt;BR /&gt;
&amp;gt; the argument you collected. As for your button macro, just include the&lt;BR /&gt;
argument&lt;BR /&gt;
&amp;gt; right after the call to vbarun:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; ^C^C^P-vbarun;MacroWithArguments;"gatevalve";&lt;BR /&gt;
&amp;gt; ^C^C^P-vbarun;MacroWithArguments;"ovalve";&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; http://www.acadx.com&lt;BR /&gt;
&amp;gt; Win an autographed copy of&lt;BR /&gt;
&amp;gt; "Mastering AutoCAD 2000 Objects"&lt;BR /&gt;
&amp;gt; by Dietmar Rudolph&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Ross Tanner" &lt;RTANNER&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:89BF744AFFF2BDEC9935368F77D0FD35@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; I have the buttons in Acad setup with the following syntax:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; ^C^C-vbarun gatevalve        or&lt;BR /&gt;
&amp;gt; &amp;gt; ^C^C-vbarun ovalve             etc.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Using this method I need to have a sub for each button to call&lt;BR /&gt;
individually.&lt;BR /&gt;
&amp;gt; &amp;gt; If I could place the block name (gatevalve, ovalve...) and the size in&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; &amp;gt; button I could call the controller function directly (after changing it&lt;BR /&gt;
to a&lt;BR /&gt;
&amp;gt; &amp;gt; sub)  Hope this explains what I am after.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Sub Gatevalve()&lt;BR /&gt;
&amp;gt; &amp;gt;     BoGus = Controller("Gatevalve", 1)&lt;BR /&gt;
&amp;gt; &amp;gt; End Sub&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Sub Ovalve()&lt;BR /&gt;
&amp;gt; &amp;gt;     BoGus = Controller("Ovalve", 1)&lt;BR /&gt;
&amp;gt; &amp;gt; End Sub&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Function Controller(BlockName, SiZe)&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     BoGus = IsLocalBlock(BlockName)&lt;BR /&gt;
&amp;gt; &amp;gt;     BoGus = LinearInSerter(BlockName, SiZe)&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; End Function&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Thanks for sharing your knowledge.&lt;BR /&gt;
&amp;gt; &amp;gt; Ross&lt;BR /&gt;
&amp;gt;&lt;/RTANNER&gt;&lt;/FRANKO&gt;</description>
      <pubDate>Tue, 10 Apr 2001 09:00:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/options-when-calling-a-function-from-a-button-within-acad/m-p/337865#M85442</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-04-10T09:00:57Z</dc:date>
    </item>
  </channel>
</rss>

