<?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: Multiple instances of Inventor - Standalone EXE in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13380559#M1389</link>
    <description>&lt;P&gt;Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i found a way where i can able to get the list of process related to inventor documents. from list the list, i can able to select the document and manipulate that document how i need..&amp;nbsp;&lt;/P&gt;&lt;P&gt;private void LoadInventorProcesses()&lt;BR /&gt;{&lt;BR /&gt;processListBox.ItemsSource = null;&lt;BR /&gt;IRunningObjectTable rot;&lt;BR /&gt;IEnumMoniker enumMoniker;&lt;BR /&gt;IMoniker[] monikers = new IMoniker[1];&lt;/P&gt;&lt;P&gt;GetRunningObjectTable(0, out rot);&lt;BR /&gt;rot.EnumRunning(out enumMoniker);&lt;BR /&gt;enumMoniker.Reset();&lt;/P&gt;&lt;P&gt;IntPtr fetched = IntPtr.Zero;&lt;BR /&gt;while (enumMoniker.Next(1, monikers, fetched) == 0)&lt;BR /&gt;{&lt;BR /&gt;IBindCtx bindCtx;&lt;BR /&gt;CreateBindCtx(0, out bindCtx);&lt;/P&gt;&lt;P&gt;string displayName;&lt;BR /&gt;monikers[0].GetDisplayName(bindCtx, null, out displayName);&lt;BR /&gt;Console.WriteLine(displayName);&lt;BR /&gt;if (displayName.Contains(".iam") || displayName.Contains(".ipt") || displayName.Contains(".idw"))&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;processListBox.Items.Add(displayName);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;private void ProcessListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)&lt;BR /&gt;{&lt;BR /&gt;var selectedProcess = (dynamic)processListBox.SelectedItem;&lt;BR /&gt;&lt;BR /&gt;processListBox.ItemsSource = null;&lt;BR /&gt;IRunningObjectTable rot;&lt;BR /&gt;IEnumMoniker enumMoniker;&lt;BR /&gt;IMoniker[] monikers = new IMoniker[1];&lt;/P&gt;&lt;P&gt;GetRunningObjectTable(0, out rot);&lt;BR /&gt;rot.EnumRunning(out enumMoniker);&lt;BR /&gt;enumMoniker.Reset();&lt;/P&gt;&lt;P&gt;IntPtr fetched = IntPtr.Zero;&lt;BR /&gt;while (enumMoniker.Next(1, monikers, fetched) == 0)&lt;BR /&gt;{&lt;BR /&gt;IBindCtx bindCtx;&lt;BR /&gt;CreateBindCtx(0, out bindCtx);&lt;/P&gt;&lt;P&gt;string displayName;&lt;BR /&gt;monikers[0].GetDisplayName(bindCtx, null, out displayName);&lt;/P&gt;&lt;P&gt;if (displayName == (dynamic)processListBox.SelectedItem )&lt;BR /&gt;{&lt;BR /&gt;object comObject;&lt;BR /&gt;rot.GetObject(monikers[0], out comObject);&lt;/P&gt;&lt;P&gt;Document oAsm = (Document)comObject;&lt;/P&gt;&lt;P&gt;oAsm.Save2(true);&lt;BR /&gt;MessageBox.Show(oAsm.DisplayName);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
    <pubDate>Thu, 20 Mar 2025 03:32:16 GMT</pubDate>
    <dc:creator>gopinathmY575P</dc:creator>
    <dc:date>2025-03-20T03:32:16Z</dc:date>
    <item>
      <title>Multiple instances of Inventor - Standalone EXE</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13376569#M1387</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm working on project where it requires to select/pick the required instance of Autodesk inventor active document from the multiple instances of inventor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance..&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 07:34:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13376569#M1387</guid>
      <dc:creator>gopinathmY575P</dc:creator>
      <dc:date>2025-03-18T07:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple instances of Inventor - Standalone EXE</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13379661#M1388</link>
      <description>&lt;P&gt;Inventor instances use the same item moniker in the running object table (ROT). You can tell how may instances of Inventor are running, but the object associated with each entry in the ROT will be the first (essentially oldest) instance of Inventor. I'm not sure how to get around this. Can you describe what you're trying to achieve? There may be some alternatives.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 15:42:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13379661#M1388</guid>
      <dc:creator>jjstr8</dc:creator>
      <dc:date>2025-03-19T15:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple instances of Inventor - Standalone EXE</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13380559#M1389</link>
      <description>&lt;P&gt;Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i found a way where i can able to get the list of process related to inventor documents. from list the list, i can able to select the document and manipulate that document how i need..&amp;nbsp;&lt;/P&gt;&lt;P&gt;private void LoadInventorProcesses()&lt;BR /&gt;{&lt;BR /&gt;processListBox.ItemsSource = null;&lt;BR /&gt;IRunningObjectTable rot;&lt;BR /&gt;IEnumMoniker enumMoniker;&lt;BR /&gt;IMoniker[] monikers = new IMoniker[1];&lt;/P&gt;&lt;P&gt;GetRunningObjectTable(0, out rot);&lt;BR /&gt;rot.EnumRunning(out enumMoniker);&lt;BR /&gt;enumMoniker.Reset();&lt;/P&gt;&lt;P&gt;IntPtr fetched = IntPtr.Zero;&lt;BR /&gt;while (enumMoniker.Next(1, monikers, fetched) == 0)&lt;BR /&gt;{&lt;BR /&gt;IBindCtx bindCtx;&lt;BR /&gt;CreateBindCtx(0, out bindCtx);&lt;/P&gt;&lt;P&gt;string displayName;&lt;BR /&gt;monikers[0].GetDisplayName(bindCtx, null, out displayName);&lt;BR /&gt;Console.WriteLine(displayName);&lt;BR /&gt;if (displayName.Contains(".iam") || displayName.Contains(".ipt") || displayName.Contains(".idw"))&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;processListBox.Items.Add(displayName);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;private void ProcessListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)&lt;BR /&gt;{&lt;BR /&gt;var selectedProcess = (dynamic)processListBox.SelectedItem;&lt;BR /&gt;&lt;BR /&gt;processListBox.ItemsSource = null;&lt;BR /&gt;IRunningObjectTable rot;&lt;BR /&gt;IEnumMoniker enumMoniker;&lt;BR /&gt;IMoniker[] monikers = new IMoniker[1];&lt;/P&gt;&lt;P&gt;GetRunningObjectTable(0, out rot);&lt;BR /&gt;rot.EnumRunning(out enumMoniker);&lt;BR /&gt;enumMoniker.Reset();&lt;/P&gt;&lt;P&gt;IntPtr fetched = IntPtr.Zero;&lt;BR /&gt;while (enumMoniker.Next(1, monikers, fetched) == 0)&lt;BR /&gt;{&lt;BR /&gt;IBindCtx bindCtx;&lt;BR /&gt;CreateBindCtx(0, out bindCtx);&lt;/P&gt;&lt;P&gt;string displayName;&lt;BR /&gt;monikers[0].GetDisplayName(bindCtx, null, out displayName);&lt;/P&gt;&lt;P&gt;if (displayName == (dynamic)processListBox.SelectedItem )&lt;BR /&gt;{&lt;BR /&gt;object comObject;&lt;BR /&gt;rot.GetObject(monikers[0], out comObject);&lt;/P&gt;&lt;P&gt;Document oAsm = (Document)comObject;&lt;/P&gt;&lt;P&gt;oAsm.Save2(true);&lt;BR /&gt;MessageBox.Show(oAsm.DisplayName);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2025 03:32:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13380559#M1389</guid>
      <dc:creator>gopinathmY575P</dc:creator>
      <dc:date>2025-03-20T03:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple instances of Inventor - Standalone EXE</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13381476#M1390</link>
      <description>&lt;P&gt;What version of Inventor are you running? This doesn't work on 2024.3.1.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2025 13:22:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13381476#M1390</guid>
      <dc:creator>jjstr8</dc:creator>
      <dc:date>2025-03-20T13:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple instances of Inventor - Standalone EXE</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13382717#M1391</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/111000"&gt;@jjstr8&lt;/a&gt;&amp;nbsp;thanks for bringing this to my notice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have both 2021 and 2024. in 2021 version I have done testing and it's working fine as per expected behaviour. whereas in 2024.3.4, it's not working.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2025 04:00:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13382717#M1391</guid>
      <dc:creator>gopinathmY575P</dc:creator>
      <dc:date>2025-03-21T04:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple instances of Inventor - Standalone EXE</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13383741#M1392</link>
      <description>&lt;P&gt;I no longer have a prior version installed. Based this post,&amp;nbsp;&lt;STRONG&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-programming-ilogic/getting-inventor-object-in-net-core/m-p/9980136" target="_blank" rel="noopener"&gt;Getting Inventor Object in NET Core&lt;/A&gt;&lt;/STRONG&gt;&amp;nbsp;, it looks like Inventor used to change its ROT moniker based on the active file. For whatever reason, it no longer does that in 2024. The only workaround I found was to have a helper addin register another moniker in the ROT which is unique for each Inventor session. It includes the Inventor session ID (Application.ADPSessionId) which is unique for each running Inventor instance. When you look in the ROT, filter for display names starting with "!Inventor-session-moniker:"&amp;nbsp; I've attached the VS2022 project if anyone is interested.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2025 15:02:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13383741#M1392</guid>
      <dc:creator>jjstr8</dc:creator>
      <dc:date>2025-03-21T15:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple instances of Inventor - Standalone EXE</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13384606#M1393</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gopinathmY575P_0-1742619762881.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1480540i9C5B84BEB25C5C81/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gopinathmY575P_0-1742619762881.png" alt="gopinathmY575P_0-1742619762881.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/111000"&gt;@jjstr8&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Mar 2025 05:02:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13384606#M1393</guid>
      <dc:creator>gopinathmY575P</dc:creator>
      <dc:date>2025-03-22T05:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple instances of Inventor - Standalone EXE</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13387182#M1394</link>
      <description>&lt;P&gt;I'm not sure what's blocking you from downloading, but here's the code only. The only reference you'll need in the project is the Inventor interop. Create a .addin file as you see fit.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;using System;
using System.Runtime.InteropServices.ComTypes;
using System.Runtime.InteropServices;
using Inventor;

namespace InventorSessionMoniker
{
    [Guid("40E41513-E47B-4151-95E3-99EB653FF433"), ComVisible(true)]
    public class StandardAddInServer : ApplicationAddInServer
    {
        [DllImport("ole32.dll")]
        private static extern int CreateItemMoniker([MarshalAs(UnmanagedType.LPWStr)] string delim, [MarshalAs(UnmanagedType.LPWStr)] string item, out IMoniker moniker);

        [DllImport("ole32.dll")]
        private static extern int GetRunningObjectTable(uint reserved, out IRunningObjectTable pprot);

        internal int _sessionMonikerId;
        internal Application _inventorApplication;

        public object Automation =&amp;gt; null;

        public void Activate(ApplicationAddInSite AddInSiteObject, bool FirstTime)
        {
            _inventorApplication = AddInSiteObject.Application;
            int hResult = GetRunningObjectTable(0, out IRunningObjectTable runningObjectTable);
            if (hResult == 0)
            {
                _ = CreateItemMoniker("!", "Inventor-session-moniker:" + _inventorApplication.ADPSessionId, out IMoniker sessionMoniker);
                _sessionMonikerId = runningObjectTable.Register(0x1, _inventorApplication, sessionMoniker);
            }
        }
        public void Deactivate()
        {
            int hResult = GetRunningObjectTable(0, out IRunningObjectTable runningObjectTable);
            if (hResult == 0)
            {
                runningObjectTable.Revoke(_sessionMonikerId);
            }
            if (_inventorApplication != null)
            {
                Marshal.ReleaseComObject(_inventorApplication);
                _inventorApplication = null;
            }
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
        public void ExecuteCommand(int CommandID) { }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2025 13:47:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/multiple-instances-of-inventor-standalone-exe/m-p/13387182#M1394</guid>
      <dc:creator>jjstr8</dc:creator>
      <dc:date>2025-03-24T13:47:26Z</dc:date>
    </item>
  </channel>
</rss>

