<?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: Issues with modal UserForms and Inventor in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-modal-userforms-and-inventor/m-p/9015202#M101140</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does putting DoEvents into the loop resolve the problem that Inventor and dialog become "white out"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dialogs that need to prevent user access to the parent window must be modal.&lt;/P&gt;&lt;P&gt;Don't try to change mode-less dialog&amp;nbsp; to modal by ignoring window messages.&lt;/P&gt;&lt;P&gt;DoEvents invokes window message loop and an application can response to OS.&lt;/P&gt;&lt;P&gt;If an application ignores window messages from OS for a long time, the window become "white out".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradical&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Sep 2019 23:51:32 GMT</pubDate>
    <dc:creator>HideoYamada</dc:creator>
    <dc:date>2019-09-09T23:51:32Z</dc:date>
    <item>
      <title>Issues with modal UserForms and Inventor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-modal-userforms-and-inventor/m-p/9006391#M101017</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;I'm having this problem since forever, so I'm asking for advice.&lt;/P&gt;&lt;P&gt;I'm using a modal userform to display output of my macros. The form is just a simple form with a large textbox and vertical scrollbar, a close button and a progress bar (self made).&lt;/P&gt;&lt;P&gt;The problem is, I need to show this form modal for certain macros, to prevent users doing anythign with the currently open document while the macro is doing it's things. The macros output sort of logging information into the textbox, and it should automatically scroll. But sometimes these macros take a looooong time to run. Sometimes even Windows7 thinks the inventor application is hung and not responding because the macros working. In these cases the modal userform disappears and goes behind the inventor window. Also, after this happens for the first time, the textbox stops scrolling completely and even though any text input to teh userform should bring it to foreground and give it focus (which is apparently required for the text scrolling to work), it does not work either.&lt;/P&gt;&lt;P&gt;The only thing I could do is, to put some DoEvents calls into the macros. This makes inventor "repsonsive" again and makes the textbox scrolling too. But the problem is, doing taht also defies the modality of the form and the user interaction events is taken by inventor and they do can manipulate teh open documents despite an open modal form.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So long story short: is there a better or recommended way to fix this?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;IV2018.3.6, W7 x64.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 18:43:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-modal-userforms-and-inventor/m-p/9006391#M101017</guid>
      <dc:creator>bshbsh</dc:creator>
      <dc:date>2019-09-04T18:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with modal UserForms and Inventor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-modal-userforms-and-inventor/m-p/9007068#M101029</link>
      <description>&lt;P&gt;Hello bshbsh,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have not understood exactly what is you problem.&lt;/P&gt;&lt;P&gt;I made a dialog.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dialog.PNG" style="width: 379px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/674120i8A60688739C5AB22/image-size/large?v=v2&amp;amp;px=999" role="button" title="dialog.PNG" alt="dialog.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code of this dialog is here :&lt;/P&gt;&lt;PRE&gt;Private StopRequired As Boolean

Private Sub StartButton_Click()
    StopRequired = False
    Dim lastTime As String
    &lt;BR /&gt;    CloseButton.Enabled = False&lt;BR /&gt;
    While Not StopRequired
        DoEvents
        
        ' Do someting
        If lastTime &amp;lt;&amp;gt; Time Then
            lastTime = Time
            Label1.Caption = lastTime
        End If
    Wend&lt;BR /&gt;&lt;BR /&gt;    CloseButton.Enabled = True
End Sub

Private Sub StopButton_Click()
    StopRequired = True
End Sub

Private Sub CloseButton_Click()
    Me.Hide
End Sub&lt;/PRE&gt;&lt;P&gt;And show the dialog as follows :&lt;/P&gt;&lt;PRE&gt;Sub test()
    UserForm1.Show
End Sub&lt;/PRE&gt;&lt;P&gt;The dialog is always in front of Inventor application window, and user cannot access Inventor application window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something conditions are different?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradical&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 03:54:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-modal-userforms-and-inventor/m-p/9007068#M101029</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-09-05T03:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with modal UserForms and Inventor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-modal-userforms-and-inventor/m-p/9010892#M101076</link>
      <description>&lt;P&gt;my form looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="still working" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/674791i848BD42747328853/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Clipboard01.jpg" alt="still working" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;still working&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;big textbox with a scrollbar. on the first pic it is still scrolling...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stopped scrolling" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/674792iC99BF9EE8067E03E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Clipboard02.jpg" alt="stopped scrolling" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;stopped scrolling&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but after a while (when the process takes too long) it stops scrolling and windows shuffles it into the background, inventor window whites out, etc. i guess it's some windows thing, if a process is "not responding" for like 10 seconds or so, it thinks it is stuck, funnily the text is still gets added to the textbox and you see the scrollbar getting smaller and smaller as the box contents get longer, but windows still thinks womehow it is a stuck process, even if it is clearly doing something.&lt;/P&gt;&lt;P&gt;and it just stops scrolling if i switch to an other window. textbox is set to have focus every time a line of text is added to it and it is also repainted and everything, but no scrolly...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stopped scrolling" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/674794i32B5579358B40C79/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Clipboard03.jpg" alt="stopped scrolling" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;stopped scrolling&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;this mostly happens if the process is taking longer than that supposed "threshold" for "stuck process" timeout.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 16:28:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-modal-userforms-and-inventor/m-p/9010892#M101076</guid>
      <dc:creator>bshbsh</dc:creator>
      <dc:date>2019-09-06T16:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with modal UserForms and Inventor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-modal-userforms-and-inventor/m-p/9011547#M101083</link>
      <description>&lt;P&gt;Hello bshbsh,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had focused on following in your first post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; The only thing I could do is, to put some DoEvents calls into the macros.&lt;/P&gt;&lt;P&gt;&amp;gt; This makes inventor "repsonsive" again and makes the textbox scrolling too.&lt;/P&gt;&lt;P&gt;&amp;gt; But the problem is, doing that also defies the modality of the form and&lt;/P&gt;&lt;P&gt;&amp;gt; the user interaction events is taken by inventor and&lt;/P&gt;&lt;P&gt;&amp;gt; they do can manipulate the open documents despite an open modal form.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as I tried, the user could not access to Inventor even when DoEvents was called in the long loop.&lt;/P&gt;&lt;P&gt;I think this is the excepted behavior because the dialog is modal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradical&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 23:49:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-modal-userforms-and-inventor/m-p/9011547#M101083</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-09-06T23:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with modal UserForms and Inventor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-modal-userforms-and-inventor/m-p/9015075#M101134</link>
      <description>&lt;P&gt;I have done some more extensive testing, and it seems like the problem i'm having (userform and inventor seemingly not responding) is NOT just with modal forms, but any forms that are running long code.&lt;/P&gt;&lt;P&gt;example: non modal userform, with a button that does the long running code, and teh long running code puts and updates a progressbar on the statusbar in the inventor main window. this starts by updating nicely until like 5-10 seconds or so, then it "whites out" and "hourglasses" and shows "not responding" in the tilebar, neither the userform nor inventor can be accessed at all. then after like a minute or so when the code actually finishes, it just booom, comes back to life, progressbar at 100%, and the code is done fine and inventor works again. and that's with putting doevents into the code loop for every iteration.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 22:05:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-modal-userforms-and-inventor/m-p/9015075#M101134</guid>
      <dc:creator>bshbsh</dc:creator>
      <dc:date>2019-09-09T22:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with modal UserForms and Inventor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-modal-userforms-and-inventor/m-p/9015202#M101140</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does putting DoEvents into the loop resolve the problem that Inventor and dialog become "white out"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dialogs that need to prevent user access to the parent window must be modal.&lt;/P&gt;&lt;P&gt;Don't try to change mode-less dialog&amp;nbsp; to modal by ignoring window messages.&lt;/P&gt;&lt;P&gt;DoEvents invokes window message loop and an application can response to OS.&lt;/P&gt;&lt;P&gt;If an application ignores window messages from OS for a long time, the window become "white out".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradical&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 23:51:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/issues-with-modal-userforms-and-inventor/m-p/9015202#M101140</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-09-09T23:51:32Z</dc:date>
    </item>
  </channel>
</rss>

