<?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 System.ArgumentException: 'An item with the Id [ID_New] already exists in the collection!' in Assembly document in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/system-argumentexception-an-item-with-the-id-id-new-already/m-p/11653664#M147235</link>
    <description>&lt;P&gt;Hello , I'm trying to create an assembly document in inventor , but I'm getting always the same exception . How can I solve this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;System.ArgumentException: 'An item with the Id [ID_New] already exists in the collection!' in Assembly document&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abdechafineji_0-1672736012497.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1158023i4C3E074F8CFC9347/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abdechafineji_0-1672736012497.png" alt="abdechafineji_0-1672736012497.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;AssemblyDocument ActiveDoc = (AssemblyDocument)oApp.ActiveDocument;
try
{

AssemblyDocument oDoc = (AssemblyDocument)InventorApp.Documents.Add(DocumentTypeEnum.kAssemblyDocumentObject, oApp.FileManager.GetTemplateFile(DocumentTypeEnum.kAssemblyDocumentObject), true); // exception here

}
catch (Exception e)
{
MessageBox.Show(e.Message);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jan 2023 08:56:18 GMT</pubDate>
    <dc:creator>abdechafi.neji</dc:creator>
    <dc:date>2023-01-03T08:56:18Z</dc:date>
    <item>
      <title>System.ArgumentException: 'An item with the Id [ID_New] already exists in the collection!' in Assembly document</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/system-argumentexception-an-item-with-the-id-id-new-already/m-p/11653664#M147235</link>
      <description>&lt;P&gt;Hello , I'm trying to create an assembly document in inventor , but I'm getting always the same exception . How can I solve this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;System.ArgumentException: 'An item with the Id [ID_New] already exists in the collection!' in Assembly document&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abdechafineji_0-1672736012497.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1158023i4C3E074F8CFC9347/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abdechafineji_0-1672736012497.png" alt="abdechafineji_0-1672736012497.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;AssemblyDocument ActiveDoc = (AssemblyDocument)oApp.ActiveDocument;
try
{

AssemblyDocument oDoc = (AssemblyDocument)InventorApp.Documents.Add(DocumentTypeEnum.kAssemblyDocumentObject, oApp.FileManager.GetTemplateFile(DocumentTypeEnum.kAssemblyDocumentObject), true); // exception here

}
catch (Exception e)
{
MessageBox.Show(e.Message);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 08:56:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/system-argumentexception-an-item-with-the-id-id-new-already/m-p/11653664#M147235</guid>
      <dc:creator>abdechafi.neji</dc:creator>
      <dc:date>2023-01-03T08:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: System.ArgumentException: 'An item with the Id [ID_New] already exists in the collection!' in Assembly document</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/system-argumentexception-an-item-with-the-id-id-new-already/m-p/11655296#M147276</link>
      <description>&lt;P&gt;I tried your code and I didn't get any exceptions. And looking at the exception message, I doubt the problem is on that line. Inventor exceptions never have such a good description message.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 21:18:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/system-argumentexception-an-item-with-the-id-id-new-already/m-p/11655296#M147276</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2023-01-03T21:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: System.ArgumentException: 'An item with the Id [ID_New] already exists in the collection!' in Assembly document</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/system-argumentexception-an-item-with-the-id-id-new-already/m-p/11655947#M147283</link>
      <description>&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;and I have one notice.&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Autodesk.Windows.ToolBars&lt;/STRONG&gt;&lt;/EM&gt; is not a member of Inventor API (see callstack)&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 07:11:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/system-argumentexception-an-item-with-the-id-id-new-already/m-p/11655947#M147283</guid>
      <dc:creator>Michael.Navara</dc:creator>
      <dc:date>2023-01-04T07:11:30Z</dc:date>
    </item>
  </channel>
</rss>

