- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
System.ArgumentException: 'An item with the Id [ID_New] already exists in the collection!' in Assembly document
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?
System.ArgumentException: 'An item with the Id [ID_New] already exists in the collection!' in Assembly document
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);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I agree with @JelteDeJong and I have one notice. Autodesk.Windows.ToolBars is not a member of Inventor API (see callstack)