<?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: User Input Error When Running Macro From AutoCAD Button in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/user-input-error-when-running-macro-from-autocad-button/m-p/8911286#M5307</link>
    <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;i tested and it looks correct. Problem will be somewhere else. I got this error only if i push key after running macro... so it throws this type of exception and it is correct&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jul 2019 08:15:47 GMT</pubDate>
    <dc:creator>BestFriendCZ</dc:creator>
    <dc:date>2019-07-16T08:15:47Z</dc:date>
    <item>
      <title>User Input Error When Running Macro From AutoCAD Button</title>
      <link>https://forums.autodesk.com/t5/vba-forum/user-input-error-when-running-macro-from-autocad-button/m-p/8909465#M5306</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem with a macro I wrote, which I believe probably has a very simple solution that I am overlooking due to inexperience with VBA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My script starts by prompting the user to select a point in the currently active drawing using this line of code:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Location_Dist = ThisDrawing.Utility.GetPoint(, "Select distribution point: ")&lt;/PRE&gt;&lt;P&gt;&lt;U&gt;This works perfectly when the code is executed from the VBA editor using the Run (F5) key&lt;/U&gt;, but it returns an error immediately when run from a custom button within AutoCAD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The button I created calls the script using the following command:&lt;/P&gt;&lt;PRE&gt;^C^C_.-vbarun;"MyModule.DistributionScript";&lt;/PRE&gt;&lt;P&gt;This reaches the script perfectly as proven by a stop-point in the code, it always reaches the "Sub DistributionScript" line. However, as soon as it reaches the user input line I pasted above, it returns the following error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 375px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/657555iACC090C82FEA94AD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suspect the error is related to AutoCAD completely skipping over the user input part by not allowing the user any time to pick a point, thus returning an error due to empty/non-existing user input. Other scripts that require no user input run just fine using the same button code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I calling the Macro in the wrong way? Am I asking for user input in the wrong way? Any help is greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 13:06:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/user-input-error-when-running-macro-from-autocad-button/m-p/8909465#M5306</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-15T13:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: User Input Error When Running Macro From AutoCAD Button</title>
      <link>https://forums.autodesk.com/t5/vba-forum/user-input-error-when-running-macro-from-autocad-button/m-p/8911286#M5307</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;i tested and it looks correct. Problem will be somewhere else. I got this error only if i push key after running macro... so it throws this type of exception and it is correct&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 08:15:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/user-input-error-when-running-macro-from-autocad-button/m-p/8911286#M5307</guid>
      <dc:creator>BestFriendCZ</dc:creator>
      <dc:date>2019-07-16T08:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: User Input Error When Running Macro From AutoCAD Button</title>
      <link>https://forums.autodesk.com/t5/vba-forum/user-input-error-when-running-macro-from-autocad-button/m-p/8911318#M5308</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While that didn't really help me solve the issue, I did find this when looking around for similar pieces of code. Adding the following code fixed my problem entirely:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ThisDrawing.Utility.InitializeUserInput 1&lt;/PRE&gt;&lt;P&gt;I just put this before the line asking for user input, and voilá. Problem solved.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 08:30:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/user-input-error-when-running-macro-from-autocad-button/m-p/8911318#M5308</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-16T08:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: User Input Error When Running Macro From AutoCAD Button</title>
      <link>https://forums.autodesk.com/t5/vba-forum/user-input-error-when-running-macro-from-autocad-button/m-p/8911381#M5309</link>
      <description>&lt;P&gt;This line disable only null user input. Question is how this input get there if you only run this macro.... but important is that problem was solved:)&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 08:58:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/user-input-error-when-running-macro-from-autocad-button/m-p/8911381#M5309</guid>
      <dc:creator>BestFriendCZ</dc:creator>
      <dc:date>2019-07-16T08:58:54Z</dc:date>
    </item>
  </channel>
</rss>

