<?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: Sending an API command while Inventor is busy causes crash; how to fix? in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/7514350#M76389</link>
    <description>&lt;P&gt;Hi @Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try to add the following C# code after every &lt;STRONG&gt;update() &lt;/STRONG&gt;API call.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Inventor.Application m_inventorApplication;
m_inventorApplication = (Inventor.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application");
m_inventorApplication.UserInterfaceManager.DoEvents();&lt;/PRE&gt;
&lt;P&gt;The &lt;STRONG&gt;DoEvents()&amp;nbsp;&lt;/STRONG&gt;API call&amp;nbsp;will allow the Inventor to complete its update and then back to the Inventor to proceed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please feel free to contact if there is any queries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Nov 2017 09:21:04 GMT</pubDate>
    <dc:creator>chandra.shekar.g</dc:creator>
    <dc:date>2017-11-03T09:21:04Z</dc:date>
    <item>
      <title>Sending an API command while Inventor is busy causes crash; how to fix?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/6780791#M69046</link>
      <description>&lt;P&gt;I'm writing a C# application using the Inventor 2016 API to automate the creation of some custom assembly drawings. After making only subtractive changes to an assembly model (removing components) and calling AssemblyDocument.Update2(true), Inventor labors for anywhere from 2-5 minutes performing the model update. Now here's the problem: as soon as Update2 is called, the .NET application is ready to send another command to Inventor, but for those following few minutes during the update operation, Inventor is "unresponsive," showing Windows 7's&amp;nbsp;"spinning blue swirl" (though not truly unresponsive in the Win32 sense, where Task Manager would show it as such). The next command I call after Update2 is AssemblyDocument.SaveAs("path", true), &lt;EM&gt;but this crashes Inventor unless I wait those few minutes for it to finish its update.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I have tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Looking at&amp;nbsp;System.Diagnostics.Process.Responding. It is always true during the update operation.&lt;/LI&gt;&lt;LI&gt;Looking at Inventor.Application.CommandManager.ActiveCommand. This is always the default command. (cf&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/check-inventor-is-idle/m-p/6017453" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/check-inventor-is-idle/m-p/6017453&lt;/A&gt;)&lt;/LI&gt;&lt;LI&gt;Using a timer to delay call of the SaveAs method. This works, but is an unacceptably fragile solution.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;It seems to me that this must be an issue encountered before, but I'm not really finding any information out there. Anyone with some insight? Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 21:25:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/6780791#M69046</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-03T21:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sending an API command while Inventor is busy causes crash; how to fix?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/6793740#M69206</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would you be able to provide a non-confidential set of files and a small sample code that would enable us to reproduce the behaviour?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Concerning&amp;nbsp;&lt;STRONG&gt;ActiveCommand&lt;/STRONG&gt;. I assume you are not creating a command for your program and run the code from it, so the &lt;STRONG&gt;ActiveCommand&lt;/STRONG&gt; would be the &lt;STRONG&gt;DefaultCommand&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I could not find anything logged against&amp;nbsp;&lt;STRONG&gt;Update2&lt;/STRONG&gt;() not executing synchronously. What about using &lt;STRONG&gt;Update&lt;/STRONG&gt;()? Does that have the same problem?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this turns out to be an issue then maybe placing your code inside a command, running that synchronously, and then waiting for the &lt;STRONG&gt;OnTerminateCommand&lt;/STRONG&gt;() event to run the &lt;STRONG&gt;SaveAs&lt;/STRONG&gt; part might be a workaround. We'll see.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2017 21:55:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/6793740#M69206</guid>
      <dc:creator>adam.nagy</dc:creator>
      <dc:date>2017-01-09T21:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sending an API command while Inventor is busy causes crash; how to fix?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/6795768#M69241</link>
      <description>&lt;P&gt;Hi Adam,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be difficult to provide any non-confidential example model here, but our company has a support agreement with Autodesk, and&amp;nbsp;we have an Autodesk implementation consultant with whom we may be able to work something out. I will try to get in touch with him.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both Update() and Update2() result in the same behavior. I'm using&amp;nbsp;Update2() to provide the "accept errors and continue" option. It's probably worthy of noting that other API calls prior to Update2() also cause Inventor to appear busy while my program is ready to proceed to other calls... it isn't only Update2(). But Update2() seems to be the only one that, if another call is made before Inventor is "done", throws an exception and crashes Inventor. The calls made before Update2()&amp;nbsp;are: OccurrencePattern.Delete(), ComponentOccurrence.Delete(), and BrowserFolder.Delete().&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;If this turns out to be an issue then maybe placing your code inside a command, running that synchronously, and then waiting for the &lt;STRONG&gt;OnTerminateCommand&lt;/STRONG&gt;() event to run the &lt;STRONG&gt;SaveAs&lt;/STRONG&gt; part might be a workaround. We'll see.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I'm unsure what you mean by this, and I suspect that "placing [our] code inside a command" isn't something I've done with the API before. It sounds at least somewhat promising. Could you link to more information about this? (When I refer to "executing an API command", I mean only executing a line of code that accesses the Inventor API.)&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2017 16:15:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/6795768#M69241</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-10T16:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sending an API command while Inventor is busy causes crash; how to fix?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/6802569#M69285</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is how you can run things inside your own command.&lt;/P&gt;
&lt;P&gt;Here is a VBA sample.&lt;/P&gt;
&lt;P&gt;E.g. have a class&amp;nbsp;named "MyCommand" with this code:&lt;/P&gt;
&lt;PRE&gt;Option Explicit

Dim WithEvents bd As ButtonDefinition

Private Sub bd_OnExecute(ByVal Context As NameValueMap)
  Dim ie As InteractionEvents
  Set ie = ThisApplication.CommandManager.CreateInteractionEvents
  
  ' Set name of ActiveCommand
  ie.Name = "MyCommand"
  Call ie.Start

  ' Do something as part of the command
  Call MsgBox("ThisApplication.CommandManager.ActiveCommand = " + _
    ThisApplication.CommandManager.ActiveCommand)
    
  Call ie.Stop
End Sub

Private Sub Class_Initialize()
  Dim cm As CommandManager
  Set cm = ThisApplication.CommandManager

  Set bd = cm.ControlDefinitions.AddButtonDefinition( _
    "MyCommand", "MyCommand", kNonShapeEditCmdType, , "MyCommand", , , , kAlwaysDisplayText)
    
  ' Run it Synchronous=True
  Call bd.Execute2(True)
  
  ' If it was really synchronous then by the time we get
  ' here we're done and don't need the command anymore
  Call bd.Delete
End Sub&lt;/PRE&gt;
&lt;P&gt;Then instantiate it from a module:&lt;/P&gt;
&lt;PRE&gt;Dim mc As MyCommand

Sub RunMyCommand()
  Set mc = New MyCommand
End Sub&lt;/PRE&gt;
&lt;P&gt;This way while your command is running, the &lt;STRONG&gt;ActiveCommand&lt;/STRONG&gt; will be "&lt;STRONG&gt;MyCommand&lt;/STRONG&gt;" and &lt;STRONG&gt;OnActivateCommand&lt;/STRONG&gt;/&lt;STRONG&gt;OnTerminateCommand&lt;/STRONG&gt; events should fire as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS: I have a couple of largeish assemblies I just could not make Inventor think too much after an Update yet.&lt;/P&gt;
&lt;P&gt;I'll try to find a way for that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 23:11:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/6802569#M69285</guid>
      <dc:creator>adam.nagy</dc:creator>
      <dc:date>2017-01-12T23:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sending an API command while Inventor is busy causes crash; how to fix?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/6803251#M69294</link>
      <description>&lt;P&gt;Got a comment from a colleague that you could also try just simply running the "Update" command synchronously from your original code:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://modthemachine.typepad.com/my_weblog/2009/03/running-commands-using-the-api.html" target="_self"&gt;http://modthemachine.typepad.com/my_weblog/2009/03/running-commands-using-the-api.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I assume that would be the&amp;nbsp;"AssemblyGlobalUpdateCmd":&lt;/P&gt;
&lt;PRE&gt;Public Sub RunUpdateCommand() 
    ' Get the CommandManager object. 
    Dim oCommandMgr As CommandManager 
    Set oCommandMgr = ThisApplication.CommandManager 

    ' Get control definition for the line command. 
    Dim oControlDef As ControlDefinition 
    Set oControlDef = oCommandMgr.ControlDefinitions.Item( _ 
                                                 "AssemblyGlobalUpdateCmd")  
    ' Execute the command. 
    Call oControlDef.Execute2(True) 
End Sub&lt;/PRE&gt;
&lt;P&gt;More info on &lt;STRONG&gt;Execute&lt;/STRONG&gt; and &lt;STRONG&gt;Execute2&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://adndevblog.typepad.com/manufacturing/2015/02/execute-vs-execute2-of-controldefinition.html" target="_self"&gt;http://adndevblog.typepad.com/manufacturing/2015/02/execute-vs-execute2-of-controldefinition.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 09:45:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/6803251#M69294</guid>
      <dc:creator>adam.nagy</dc:creator>
      <dc:date>2017-01-13T09:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sending an API command while Inventor is busy causes crash; how to fix?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/6914016#M70572</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;we have an Autodesk implementation consultant with whom we may be able to work something out. I will try to get in touch with him.&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P&gt;Did you do that in the end? Any luck?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did either of the workaround ideas I came up with was of any help? &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@795596742BBE9063EFA1B55C0747436D/emoticons/1f615.png" alt=":confused_face:" title=":confused_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 23:31:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/6914016#M70572</guid>
      <dc:creator>adam.nagy</dc:creator>
      <dc:date>2017-03-01T23:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sending an API command while Inventor is busy causes crash; how to fix?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/6918670#M70601</link>
      <description>&lt;P&gt;I did try your suggestions but didn't have any luck with them. Our Autodesk consultant set up a session with an Inventor specialist and myself, and we determined that the crashing problems are resulting from some components in the assemblies not being migrated to the latest version of Inventor. It wouldn't seem like migration is necessary, but sure enough after migrating all the components and assemblies, our crashing problems disappeared.&amp;nbsp;So it appears that what seemed on the surface like one issue was really another. Since then, our focus has been entirely on migrating everything in our Vault, which has been dogged with many setbacks and complications. Getting there though.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 13:49:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/6918670#M70601</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-03T13:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sending an API command while Inventor is busy causes crash; how to fix?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/6919124#M70605</link>
      <description>&lt;P&gt;Thanks for the info!&lt;/P&gt;
&lt;P&gt;I'm just glad you're not stuck on this! &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 15:56:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/6919124#M70605</guid>
      <dc:creator>adam.nagy</dc:creator>
      <dc:date>2017-03-03T15:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Sending an API command while Inventor is busy causes crash; how to fix?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/7451439#M75694</link>
      <description>&lt;P&gt;Hi Adam - i think i am experiencing the same issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am putting a &lt;EM&gt;Thread.Sleep(36 seconds or more)&lt;/EM&gt; in my c# code after any COM call to the following Inventor methods in order to avoid moving on to the next api call too quickly...&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;myAssembly.Update()&lt;/LI&gt;&lt;LI&gt;myAssembly.Save()&lt;/LI&gt;&lt;LI&gt;myAssembly.Close()&lt;/LI&gt;&lt;LI&gt;InventorApp.Quit()&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;(that's not an exhaustive list btw, it's just the ones i have currently noticed and am troubleshooting)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The &lt;EM&gt;Thread.Sleep()&lt;/EM&gt; is not required for assemblies less than about say 500 parts&amp;nbsp;- but where we get the COM errors is when our assemblies are typically 1000 to 5000 parts.&amp;nbsp; In my case, we are not using Vault and all our parts are created in Inventor 2016 - and so we do not have the underlying issue of badly migrated parts that the OP had.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it seems to me that our c# code moves on to the next call even though Inventor is still actually busy finishing the .Save() the .Close() or the .Update() methods.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really don't like the vulnerability of the Thread.Sleep() workaround.&amp;nbsp; How long a sleep is enough?? - depends on the assembly!&lt;/P&gt;&lt;P&gt;So I shall follow your advice above and try to swap out our API calls above for the equivalent command and call the command with the Execute2() method as you advise.&amp;nbsp; I will report back if this is successful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, is this as issue that can be properly addressed by Autodesk so that the vulnerability in the API is removed in future releases?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 14:28:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/7451439#M75694</guid>
      <dc:creator>DynamicObjects</dc:creator>
      <dc:date>2017-10-11T14:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Sending an API command while Inventor is busy causes crash; how to fix?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/7451453#M75695</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;EM&gt;I am putting a Thread.Sleep(36 seconds or more) in my c# code after any COM call to the following Inventor methods..&lt;/EM&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;-&amp;nbsp; myAssembly.Save()&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;-&amp;nbsp; myAssembly.Close()&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;- InventorApp.Quit()&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually, after eliminating this issue in Inventor 2016 (as I stated above), it was back in 2018. This is exactly what I ended up having to do in Inventor 2018 after struggling with it for an unreasonable amount of time. Not an elegant solution, but it works. The crash could never be duplicated when stepping through the code, so I concluded it had something to do with the timing of COM calls.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 14:09:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/7451453#M75695</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-11T14:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sending an API command while Inventor is busy causes crash; how to fix?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/7514350#M76389</link>
      <description>&lt;P&gt;Hi @Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try to add the following C# code after every &lt;STRONG&gt;update() &lt;/STRONG&gt;API call.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Inventor.Application m_inventorApplication;
m_inventorApplication = (Inventor.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application");
m_inventorApplication.UserInterfaceManager.DoEvents();&lt;/PRE&gt;
&lt;P&gt;The &lt;STRONG&gt;DoEvents()&amp;nbsp;&lt;/STRONG&gt;API call&amp;nbsp;will allow the Inventor to complete its update and then back to the Inventor to proceed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please feel free to contact if there is any queries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 09:21:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/7514350#M76389</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2017-11-03T09:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sending an API command while Inventor is busy causes crash; how to fix?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/8023545#M84697</link>
      <description>&lt;P&gt;Actually I'm dealing with some similar issue. The UserInterface.DoEvents (as Chandra described in Message 11) worked for my case, I believe a better apporach were to introduce an "Application.Idle" event (like the "Editor.EnteringQuiescentState"-Event in Acad) to be fired, when Inventor is really ready for the next command, or even better a Read-Only Property "Application.Idle". Currently there is only an &lt;EM&gt;Application.OnReady&lt;/EM&gt; Event, which fires on AppStart only...&lt;/P&gt;&lt;P&gt;Alternatively the TransactionManager.CurrentTransactoin could be cast as &lt;EM&gt;null&lt;/EM&gt; if the default UI-Transaction is running (though this would return false result on nontransacting commands, like Measure).&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really hope, the "idle" State/Event will be considered to implement in future releases (maybe it's already in the idea station - didn't check &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;)&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 12:03:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/8023545#M84697</guid>
      <dc:creator>dba78</dc:creator>
      <dc:date>2018-05-24T12:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sending an API command while Inventor is busy causes crash; how to fix?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/8023602#M84700</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1670633"&gt;@dba78&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please log this wish list at idea station using below link.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 12:19:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/8023602#M84700</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2018-05-24T12:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sending an API command while Inventor is busy causes crash; how to fix?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/8023938#M84707</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this solve the problem&lt;/P&gt;&lt;PRE&gt;Public Sub main()

Dim a As inventor.Application
Set a = ThisApplication

If a.Ready Then

'PUT YOUR CODE HERE

Else
MsgBox "Not ready try again"
End If
End Sub&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 May 2018 14:16:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/sending-an-api-command-while-inventor-is-busy-causes-crash-how/m-p/8023938#M84707</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2018-05-24T14:16:58Z</dc:date>
    </item>
  </channel>
</rss>

