<?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 iLogic rule fails when trying to connect to a running instance of Inventor in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-fails-when-trying-to-connect-to-a-running-instance/m-p/7931946#M83274</link>
    <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An ilogic rule is triggered by an ERP Configurator. An Inventor instance is already running as a process and it was launched by a processor before running the iLogic rule.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I only use iLogic syntax (snippets) within the rule, it works very well. However, if I include API objects (methods and properties), it fails. It doesn't recognize the API objects. ilogic doesn't need to get the Application (ThisApplication or Inventor.Application), but API does. I'm using the following code to get the Application but it doesn't work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;&lt;STRONG&gt;' Connect to a running instance of Inventor.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim invApp As Inventor.Application&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;invApp = System.Runtime.InteropServices.Marshal.GetActiveObject&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;("Inventor.Application")&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've been trying to do simple things like displaying a message showing the ActiveDocument.DisplayName or ActiveDocument.FullFileName, but it doesn't work. Any idea how to connect to an existing Inventor instance from an iLogic rule? Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Apr 2018 20:33:00 GMT</pubDate>
    <dc:creator>sergio_duran</dc:creator>
    <dc:date>2018-04-13T20:33:00Z</dc:date>
    <item>
      <title>iLogic rule fails when trying to connect to a running instance of Inventor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-fails-when-trying-to-connect-to-a-running-instance/m-p/7931946#M83274</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An ilogic rule is triggered by an ERP Configurator. An Inventor instance is already running as a process and it was launched by a processor before running the iLogic rule.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I only use iLogic syntax (snippets) within the rule, it works very well. However, if I include API objects (methods and properties), it fails. It doesn't recognize the API objects. ilogic doesn't need to get the Application (ThisApplication or Inventor.Application), but API does. I'm using the following code to get the Application but it doesn't work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;&lt;STRONG&gt;' Connect to a running instance of Inventor.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim invApp As Inventor.Application&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;invApp = System.Runtime.InteropServices.Marshal.GetActiveObject&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;("Inventor.Application")&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've been trying to do simple things like displaying a message showing the ActiveDocument.DisplayName or ActiveDocument.FullFileName, but it doesn't work. Any idea how to connect to an existing Inventor instance from an iLogic rule? Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 20:33:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-fails-when-trying-to-connect-to-a-running-instance/m-p/7931946#M83274</guid>
      <dc:creator>sergio_duran</dc:creator>
      <dc:date>2018-04-13T20:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic rule fails when trying to connect to a running instance of Inventor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-fails-when-trying-to-connect-to-a-running-instance/m-p/7932006#M83275</link>
      <description>&lt;P&gt;How are you running these rules?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;iLogic in and of itself is embedded in inventor, so you should just be able to get inventor by ThisApplication. I don't think you would be able to connect to a separate instance of inventor from within one iLogic rule, but you can connect to the one in which the rule is ran from.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 21:15:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-fails-when-trying-to-connect-to-a-running-instance/m-p/7932006#M83275</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2018-04-13T21:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic rule fails when trying to connect to a running instance of Inventor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-fails-when-trying-to-connect-to-a-running-instance/m-p/7932053#M83276</link>
      <description>&lt;P&gt;Hi Justin,&lt;/P&gt;&lt;P&gt;Thanks for your reply! iLogic rule is run from an external application that loaded the iLogic dlls (&lt;SPAN&gt;Autodesk.iLogic.Automation.dll and Autodesk.iLogic.Interfaces.dll&lt;/SPAN&gt;). Let's say this code executes an iLogic rule named "Configure", then it starts my ilogic rule, makes the changes and it's done. If I only use iLogic syntax (snippets) is fine, but when I combine these iLogic syntax with API objects within the same iLoigc rule, it fails. If I manually open Inventor and run the iLogic rule "Configure" from the Inventor session that I manually opened, it works well with both iLogic syntax and API objects as long as I used 'ThisApplication' to get the API objects. However, in the real scenario, I'm not opening Inventor manually, Inventor is already open by an&amp;nbsp;external processor&amp;nbsp;and I need to connect to that existing/running instance of Inventor. Then, in my code I won't use 'ThisApplication', because I didn't launch it (it's already running). I should use&amp;nbsp;&lt;SPAN&gt;System.Runtime.InteropServices.Marshal.GetActiveObject ("Inventor.Application") but it doesn't work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I hope I explained my situation better.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any idea? Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 21:52:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-fails-when-trying-to-connect-to-a-running-instance/m-p/7932053#M83276</guid>
      <dc:creator>sergio_duran</dc:creator>
      <dc:date>2018-04-13T21:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic rule fails when trying to connect to a running instance of Inventor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-fails-when-trying-to-connect-to-a-running-instance/m-p/7932062#M83277</link>
      <description>&lt;P&gt;So you external application doesn't connect to Inventor, and only to the iLogic addin? Why not just connect to the inventor application with your external application and then use the&amp;nbsp;iLogic addin within the scope of the inventor application?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any iLogic rule that is ran within inventor should be aware of the application that it's running from, but if you are somehow running the add-in directly, it would make sense that it's tripping up as I don't think iLogic was ever intended to be utilized separately from the main application.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 21:55:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-fails-when-trying-to-connect-to-a-running-instance/m-p/7932062#M83277</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2018-04-13T21:55:39Z</dc:date>
    </item>
  </channel>
</rss>

