<?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 get addin to run in multiple instances of inventor in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-addin-to-run-in-multiple-instances-of-inventor/m-p/5896519#M59716</link>
    <description>&lt;P&gt;I've just converted a standalone application in to an inventor addin, I want to be able to run this addin in multiple instances of Inventor on the same computer. However when the app is running and I open the app in another instance, the original crashes and the new instance doesn't function correctly, I think the new instance of the app is refering to the original instance of Inventor and it might be somthing to do with the way i'm using the getactiveobject function. Should the below give we what I want? Or is there an alternative to getactiveobject.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        Try
            ' Attempt to get a reference to a running instance of Inventor
            InvApp = Marshal.GetActiveObject("Inventor.Application")


            Dim oDoc As AssemblyDocument = InvApp.ActiveEditDocument
        Catch&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 Nov 2015 15:45:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-11-06T15:45:47Z</dc:date>
    <item>
      <title>get addin to run in multiple instances of inventor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-addin-to-run-in-multiple-instances-of-inventor/m-p/5896519#M59716</link>
      <description>&lt;P&gt;I've just converted a standalone application in to an inventor addin, I want to be able to run this addin in multiple instances of Inventor on the same computer. However when the app is running and I open the app in another instance, the original crashes and the new instance doesn't function correctly, I think the new instance of the app is refering to the original instance of Inventor and it might be somthing to do with the way i'm using the getactiveobject function. Should the below give we what I want? Or is there an alternative to getactiveobject.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        Try
            ' Attempt to get a reference to a running instance of Inventor
            InvApp = Marshal.GetActiveObject("Inventor.Application")


            Dim oDoc As AssemblyDocument = InvApp.ActiveEditDocument
        Catch&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Nov 2015 15:45:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-addin-to-run-in-multiple-instances-of-inventor/m-p/5896519#M59716</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-06T15:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: get addin to run in multiple instances of inventor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-addin-to-run-in-multiple-instances-of-inventor/m-p/5896705#M59720</link>
      <description>When your addin's Activate method is called, the first argument (IDispatch*) implements the interface ApplicationAddInSite.  You can get the running Application object from there.</description>
      <pubDate>Fri, 06 Nov 2015 17:06:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-addin-to-run-in-multiple-instances-of-inventor/m-p/5896705#M59720</guid>
      <dc:creator>ruthsteed</dc:creator>
      <dc:date>2015-11-06T17:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: get addin to run in multiple instances of inventor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-addin-to-run-in-multiple-instances-of-inventor/m-p/5900837#M59783</link>
      <description>&lt;P&gt;Can i define this in another module and will it work in the same way or is it necessary to parse this through to the new module?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently trying and failing with this;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    Public Shared addInSiteObject As Inventor.ApplicationAddInSite

    Private Sub Export(sender As Object, e As EventArgs) Handles MyBase.Load

        System.Windows.Forms.Application.EnableVisualStyles()

        Try

            InvApp = addInSiteObject.Application

            Dim oDoc As AssemblyDocument = InvApp.ActiveEditDocument
        Catch
            MsgBox("64", 64, Title)
            Return
        End Try

...&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Nov 2015 11:43:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-addin-to-run-in-multiple-instances-of-inventor/m-p/5900837#M59783</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-10T11:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: get addin to run in multiple instances of inventor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-addin-to-run-in-multiple-instances-of-inventor/m-p/5902242#M59801</link>
      <description>I'm not sure I understand the question. You should be able to hold on to the Application pointer and pass it between modules.  I'm not sure how this would work with a public shared variable. Typically, you would use a public property on your Add-In object/main class and hold on to the Application as a private member on the class instance, but it should also work with a shared variable. Are you sure that the addInSiteObject has been set prior to the call to Export?  In other words, is there a valid addInSitObject to get the Application from here?</description>
      <pubDate>Tue, 10 Nov 2015 23:38:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-addin-to-run-in-multiple-instances-of-inventor/m-p/5902242#M59801</guid>
      <dc:creator>ruthsteed</dc:creator>
      <dc:date>2015-11-10T23:38:31Z</dc:date>
    </item>
  </channel>
</rss>

