<?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: Why execution is faster when mouse moving on screen in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/10158424#M75871</link>
    <description>Thanks MjDeck, I will try this.&lt;BR /&gt;</description>
    <pubDate>Mon, 15 Mar 2021 18:38:04 GMT</pubDate>
    <dc:creator>BenoitLarocque000</dc:creator>
    <dc:date>2021-03-15T18:38:04Z</dc:date>
    <item>
      <title>Why execution is faster when mouse moving on screen</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/8792842#M75860</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes I know the topic can make smile ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use Inventor API from external program, application is visible (but sometime I notice this behavior with iLogic).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I execute a loop in huge collection (on part faces, on part edges, or drawing entities, etc.), I notice program execute faster if I move mouse on Inventor application!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don’t have specific sample, but would you know why behaviour happens? And how to correct this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 14:38:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/8792842#M75860</guid>
      <dc:creator>fsanchou</dc:creator>
      <dc:date>2019-05-15T14:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why execution is faster when mouse moving on screen</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/8793344#M75861</link>
      <description>Maybe it has to do with the screen update of inventor. This is maybe triggered with the mouse move!</description>
      <pubDate>Wed, 15 May 2019 17:34:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/8793344#M75861</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2019-05-15T17:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why execution is faster when mouse moving on screen</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/8803764#M75862</link>
      <description>&lt;P&gt;This is a known behavior and is common with among all programs that support a COM API interface.&amp;nbsp; What's happening is that Inventor has a single main thread that is handling all interaction with Inventor.&amp;nbsp; This includes using the UI and also external API calls.&amp;nbsp; Inventor is watching the UI and also watching for API calls to come in from the single thread.&amp;nbsp; This is one of the biggest reasons that running an out-of-process program is much slower than running in-process.&amp;nbsp; For some reason moving the mouse causes Inventor to more frequently handle the incoming API calls.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The solution to this is to use the Application.UserInterfaceManager.UserInteractionDisabled property.&amp;nbsp; This blocks all interaction with the UI and allows Inventor to focus on the incoming API calls.&amp;nbsp; You'll need to set it to True at the beginning and then back to False at the end so you can interact with Inventor after the program has finished running.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 07:02:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/8803764#M75862</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2019-05-21T07:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why execution is faster when mouse moving on screen</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/8803894#M75863</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5741855"&gt;@BrianEkins&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thank you for that precise answer, it's works properly now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An initial test take &lt;STRONG&gt;30s&lt;/STRONG&gt; without mouse movement, take &lt;STRONG&gt;17s&lt;/STRONG&gt; when mouse moving and take &lt;STRONG&gt;16s&lt;/STRONG&gt; with&amp;nbsp;UserInteractionDisabled property.&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;</description>
      <pubDate>Tue, 21 May 2019 07:55:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/8803894#M75863</guid>
      <dc:creator>fsanchou</dc:creator>
      <dc:date>2019-05-21T07:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why execution is faster when mouse moving on screen</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/9873523#M75864</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the same type of&amp;nbsp; problem from an iLogic rule that updates drawing view position and scale.&lt;/P&gt;&lt;P&gt;The rule hangs while trying to retrieve a view Width property.&lt;/P&gt;&lt;P&gt;I tried to disable the user interaction without success.&lt;/P&gt;&lt;P&gt;The program can be Locked for 30 or 40 seconds if I dont move the mouse.&lt;/P&gt;&lt;P&gt;the program resume as soon as I move the mouse.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code that seem to hang. This code is triggered by a trigger parameter and driven by an Inventor Addin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;StatusBarText&lt;/SPAN&gt; = &lt;SPAN&gt;"#2B - ElevationViewName: "&lt;/SPAN&gt; + &lt;SPAN&gt;ElevationViewName&lt;/SPAN&gt;
	
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;CurrentWidth&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt; = &lt;SPAN&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN&gt;View&lt;/SPAN&gt;(&lt;SPAN&gt;ElevationViewName&lt;/SPAN&gt;).&lt;SPAN&gt;View&lt;/SPAN&gt;.&lt;SPAN&gt;Width&lt;/SPAN&gt; 
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;CurrentHeight&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt; = &lt;SPAN&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN&gt;View&lt;/SPAN&gt;(&lt;SPAN&gt;ElevationViewName&lt;/SPAN&gt;).&lt;SPAN&gt;View&lt;/SPAN&gt;.&lt;SPAN&gt;Height&lt;/SPAN&gt;
	&lt;/PRE&gt;&lt;P&gt;Any hint on this problem?&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;Benoit Larocque&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 20:25:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/9873523#M75864</guid>
      <dc:creator>BenoitLarocque000</dc:creator>
      <dc:date>2020-11-16T20:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why execution is faster when mouse moving on screen</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/9898017#M75865</link>
      <description>This is absolutely mind-blowing but it works. I don't know what to say really. One of our employees got aware of this situation when he was trying out some sequences of code. This should be put into documentation or something.</description>
      <pubDate>Thu, 26 Nov 2020 20:59:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/9898017#M75865</guid>
      <dc:creator>tolgay.hickiran</dc:creator>
      <dc:date>2020-11-26T20:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why execution is faster when mouse moving on screen</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/9898921#M75866</link>
      <description>&lt;P&gt;You mean something like this:&amp;nbsp;&lt;A href="https://modthemachine.typepad.com/my_weblog/2015/09/improving-your-programs-performance.html" target="_blank" rel="noopener"&gt;Improving Your Program’s Performance&lt;/A&gt;&amp;nbsp;&amp;nbsp;(by Brian Ekins, Mod The Machine).&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 09:10:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/9898921#M75866</guid>
      <dc:creator>_dscholtes_</dc:creator>
      <dc:date>2020-11-27T09:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why execution is faster when mouse moving on screen</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/9899829#M75867</link>
      <description>&lt;P&gt;On my side, as a workaround, I found a way to move the cursor from the driving addin and this solved the problem&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To be clear, the iLogic code is triggered by an Addin. The addin has a Progress bar dialog box including a cancel button that runs in another thread.&lt;/P&gt;&lt;P&gt;I added a timer on the progress bar dialog that moves the cursor over the drawing area every 20 seconds to&amp;nbsp; wake up Inventor.&amp;nbsp; &amp;nbsp;&amp;nbsp;I know that it's really dirty but it solved the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This problem is supposed to be present only when using external executable to drive Inventor. but it is present in iLogic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the user runs the iLogic manually and if he doesn't use the mouse, then Inventor "hangs up". And it hangs up always at the same instruction. Then if the user just move the mouse then Inventor wakes up and complete the view update process.&amp;nbsp; &amp;nbsp; Very funny!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Benoit Larocque&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 17:07:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/9899829#M75867</guid>
      <dc:creator>BenoitLarocque000</dc:creator>
      <dc:date>2020-11-27T17:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why execution is faster when mouse moving on screen</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/9905179#M75868</link>
      <description>No I mean the official help documentation.</description>
      <pubDate>Mon, 30 Nov 2020 20:15:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/9905179#M75868</guid>
      <dc:creator>tolgay.hickiran</dc:creator>
      <dc:date>2020-11-30T20:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why execution is faster when mouse moving on screen</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/9905406#M75869</link>
      <description>&lt;P&gt;I didn't find any thing in the official doc about this kind of problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 21:54:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/9905406#M75869</guid>
      <dc:creator>BenoitLarocque</dc:creator>
      <dc:date>2020-11-30T21:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why execution is faster when mouse moving on screen</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/10158371#M75870</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2809938"&gt;@BenoitLarocque&lt;/a&gt;&amp;nbsp;, please try disabling drawing background updates in your code. If you do that, it should get rid of the need to simulate the mouse move.&lt;BR /&gt;This option is "Enable background updates", at the bottom of the Drawing tab on the Tools &amp;gt; Options &amp;gt; Application Options dialog.&lt;BR /&gt;To disable it temporarily in code, add these lines before you make any changes that would cause drawing views to recompute:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Dim savedEnableBU = ThisApplication.DrawingOptions.EnableBackgroundUpdates
ThisApplication.DrawingOptions.EnableBackgroundUpdates = False
	
Try
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then after the drawing view update(s):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Finally
  ThisApplication.DrawingOptions.EnableBackgroundUpdates = savedEnableBU
End Try&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try ... Finally will make sure that the existing setting is restored, even if your code had an error.&lt;BR /&gt;&lt;BR /&gt;The view background updates are most useful when you're working interactively. You don't have to wait for views with a lot of geometry to recompute. But they're not so useful in automated procedures, where you might have to read data from a view after it updates.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 18:28:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/10158371#M75870</guid>
      <dc:creator>MjDeck</dc:creator>
      <dc:date>2021-03-15T18:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Why execution is faster when mouse moving on screen</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/10158424#M75871</link>
      <description>Thanks MjDeck, I will try this.&lt;BR /&gt;</description>
      <pubDate>Mon, 15 Mar 2021 18:38:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/why-execution-is-faster-when-mouse-moving-on-screen/m-p/10158424#M75871</guid>
      <dc:creator>BenoitLarocque000</dc:creator>
      <dc:date>2021-03-15T18:38:04Z</dc:date>
    </item>
  </channel>
</rss>

