<?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: Inventor getting slower when running API Asynchronous in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-getting-slower-when-running-api-asynchronous/m-p/11858651#M150751</link>
    <description>&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;I can definitely say Inventor API is not designed for multitasking or parallel programming. I don't know if its really fits your situation but&amp;nbsp;&lt;SPAN&gt;If there is really necessary to tasks being processed in async, I think the best way is running multiple Inventor sessions. But in this scenario you need to manage cores/threads really carefully.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But there are ways to make API work faster. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;invApp.Visible = false; //Makes Application invisible 
invApp.SilentOperation = true; // Blocks the popup windows
invApp.AssemblyOptions.DeferUpdate = false;  // Blocks the DeferUpdates
invApp.ScreenUpdating = false; // Blocs the Screen Updating
invApp.UserInterfaceManager.UserInteractionDisabled = true; //Disables the user interaction&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you start the process you can use this settings to make inventor run faster. If you need view or user interaction, you can open them and close again during the process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Devrim&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2023 09:22:53 GMT</pubDate>
    <dc:creator>Dev_rim</dc:creator>
    <dc:date>2023-03-30T09:22:53Z</dc:date>
    <item>
      <title>Inventor getting slower when running API Asynchronous</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-getting-slower-when-running-api-asynchronous/m-p/11855577#M150707</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I'm trying to call some API methods in an asynchronous way, but when running my program, the Inventor is getting slower, and I also detect high CPU usage.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you !!&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;        TextGraphics textGraphics = null;
        GraphicsNode oGraphicNode;
        static void CreateTextGraphic(GraphicsNode oGraphicNode, string Text)
        {
            DeleteClientGraphicPrimitive();
            if (textGraphics != null)
            {
                textGraphics.Delete();
            }
            Point Origin = oApp.TransientGeometry.CreatePoint(0, 0, 0);
            Point2d AnchoredPoint = oApp.TransientGeometry.CreatePoint2d(100, 0);

            //Create text graphics.
            textGraphics = oGraphicNode.AddTextGraphics();
            textGraphics.Text = Text;
           
            textGraphics.SetViewSpaceAnchor(Origin, AnchoredPoint, ViewLayoutEnum.kTopLeftViewCorner); ;
            textGraphics.SetTransformBehavior(Origin, DisplayTransformBehaviorEnum.kFrontFacingAndPixelScaling, 100);
            oApp.ActiveView.Update();
          
        }
         static async Task UpdateTextGraphics()
        {
            int i = 0;
            try
            {
                do
                {

                    await Task.Run(() =&amp;gt; CreateTextGraphic(oGraphicNode,i.ToString()));
                    i++;

                } while (true);


            }
            catch (OperationCanceledException)
            {
                Console.WriteLine($"\n{nameof(OperationCanceledException)} thrown\n");
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 08:33:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-getting-slower-when-running-api-asynchronous/m-p/11855577#M150707</guid>
      <dc:creator>bouchahouaimen</dc:creator>
      <dc:date>2023-03-29T08:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor getting slower when running API Asynchronous</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-getting-slower-when-running-api-asynchronous/m-p/11858651#M150751</link>
      <description>&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;I can definitely say Inventor API is not designed for multitasking or parallel programming. I don't know if its really fits your situation but&amp;nbsp;&lt;SPAN&gt;If there is really necessary to tasks being processed in async, I think the best way is running multiple Inventor sessions. But in this scenario you need to manage cores/threads really carefully.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But there are ways to make API work faster. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;invApp.Visible = false; //Makes Application invisible 
invApp.SilentOperation = true; // Blocks the popup windows
invApp.AssemblyOptions.DeferUpdate = false;  // Blocks the DeferUpdates
invApp.ScreenUpdating = false; // Blocs the Screen Updating
invApp.UserInterfaceManager.UserInteractionDisabled = true; //Disables the user interaction&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you start the process you can use this settings to make inventor run faster. If you need view or user interaction, you can open them and close again during the process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Devrim&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 09:22:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-getting-slower-when-running-api-asynchronous/m-p/11858651#M150751</guid>
      <dc:creator>Dev_rim</dc:creator>
      <dc:date>2023-03-30T09:22:53Z</dc:date>
    </item>
  </channel>
</rss>

