<?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: Components.AddContentCenterPart in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/components-addcontentcenterpart/m-p/12384740#M16563</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp; Thanks for taking the time to reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was looking though the documentation yesterday night but I couldn't figure out a way to make it work. Today with a bit of fresh energy I have found a solution.&lt;/P&gt;&lt;P&gt;First, I've created a custom parameter in the family table just to give "customValues As Object()" something to change, it does not drive anything.&lt;/P&gt;&lt;P&gt;Here is the rest&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAsmName&lt;/SPAN&gt; = &lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt;.&lt;SPAN&gt;DisplayName&lt;/SPAN&gt;.&lt;SPAN&gt;Replace&lt;/SPAN&gt;(&lt;SPAN&gt;".iam"&lt;/SPAN&gt;, &lt;SPAN&gt;""&lt;/SPAN&gt;)
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPath&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Path&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oFolderName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; =&lt;SPAN&gt;"Components"&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oFolder&lt;/SPAN&gt; = &lt;SPAN&gt;oPath&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"\"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oFolderName&lt;/SPAN&gt; 
        &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Not&lt;/SPAN&gt; &lt;SPAN&gt;System&lt;/SPAN&gt;.&lt;SPAN&gt;IO&lt;/SPAN&gt;.&lt;SPAN&gt;Directory&lt;/SPAN&gt;.&lt;SPAN&gt;Exists&lt;/SPAN&gt;(&lt;SPAN&gt;oFolder&lt;/SPAN&gt;) &lt;SPAN&gt;Then&lt;/SPAN&gt;
            &lt;SPAN&gt;System&lt;/SPAN&gt;.&lt;SPAN&gt;IO&lt;/SPAN&gt;.&lt;SPAN&gt;Directory&lt;/SPAN&gt;.&lt;SPAN&gt;CreateDirectory&lt;/SPAN&gt;(&lt;SPAN&gt;oFolder&lt;/SPAN&gt;)
        &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN&gt;If TopPlate_Bespoke = True Then&lt;BR /&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;Top_plate&lt;/SPAN&gt; = &lt;SPAN&gt;Components&lt;/SPAN&gt;.&lt;SPAN&gt;AddCustomContentCenterPart&lt;/SPAN&gt;(&lt;SPAN&gt;"Top plate"&lt;/SPAN&gt;,
                                                &lt;SPAN&gt;"Plates:Rack unit plates"&lt;/SPAN&gt;,
                                                &lt;SPAN&gt;"Top Plate"&lt;/SPAN&gt;,
                                                {&lt;SPAN&gt;"Member"&lt;/SPAN&gt;, &lt;SPAN&gt;"Top Plate-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;Colour&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;Type&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;Depth&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"x"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;Type_Dim&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;" mm"&lt;/SPAN&gt; },
						{&lt;SPAN&gt;"Cparam"&lt;/SPAN&gt;, &lt;SPAN&gt;"1"&lt;/SPAN&gt; },
						&lt;SPAN&gt;asCustom&lt;/SPAN&gt; := &lt;SPAN&gt;True&lt;/SPAN&gt;, &lt;SPAN&gt;partFolder&lt;/SPAN&gt; := &lt;SPAN&gt;oFolder&lt;/SPAN&gt;, &lt;SPAN&gt;partFilename&lt;/SPAN&gt; := &lt;SPAN&gt;"Top Plate"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oAsmName&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;".ipt"&lt;/SPAN&gt;)&lt;BR /&gt;End If &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Hope it makes some sense&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Nov 2023 19:17:55 GMT</pubDate>
    <dc:creator>florescu.d95</dc:creator>
    <dc:date>2023-11-17T19:17:55Z</dc:date>
    <item>
      <title>Components.AddContentCenterPart</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/components-addcontentcenterpart/m-p/12382757#M16561</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This piece of code adds/updates&amp;nbsp; a standard content center part (Top plate) in my assembly.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;TopPlate_Bespoke&lt;/SPAN&gt;= &lt;SPAN&gt;False&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt; 
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;Top_plate&lt;/SPAN&gt; = &lt;SPAN&gt;Components&lt;/SPAN&gt;.&lt;SPAN&gt;AddContentCenterPart&lt;/SPAN&gt;(&lt;SPAN&gt;"Top plate"&lt;/SPAN&gt;,
                                                &lt;SPAN&gt;"Plates:Rack unit plates"&lt;/SPAN&gt;,
                                                &lt;SPAN&gt;"Top Plate"&lt;/SPAN&gt;,
                                                 {&lt;SPAN&gt;"Member"&lt;/SPAN&gt;, &lt;SPAN&gt;"Top Plate-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;Colour&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;Type&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;Depth&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"x"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;Type_Dim&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;" mm"&lt;/SPAN&gt; })
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Sometimes I need to add the Top plate as Custom (&lt;SPAN&gt;TopPlate_Bespoke&lt;/SPAN&gt;= True)&amp;nbsp;and save it int the project folder with a different name in order to perform modifications to it.&lt;/P&gt;&lt;P&gt;How would this be done? I have seen that Components.AddCustomContentCenterPart exists but could't figure it out.&lt;/P&gt;&lt;P&gt;My goal is to achieve the same result as when manually placing a content center part as custom.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1262283"&gt;@NachoShaw&lt;/a&gt;,&amp;nbsp;any clues?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 22:34:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/components-addcontentcenterpart/m-p/12382757#M16561</guid>
      <dc:creator>florescu.d95</dc:creator>
      <dc:date>2023-11-16T22:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Components.AddContentCenterPart</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/components-addcontentcenterpart/m-p/12384535#M16562</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10187446"&gt;@florescu.d95&lt;/a&gt;.&amp;nbsp; I know you tagged me on this one, but I am most likely not the best one to reply on this one, because I honestly never use that iLogic snippet for adding a custom content center part to an assembly.&amp;nbsp; What I can do is point you to the online help page for that snippet, which might have better explanations than the Intellisense system tips offer while writing the code into an iLogic rule.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=2ce46092-1092-e27b-2c1e-3a10e696fc52" target="_blank" rel="noopener"&gt;IManagedComponents.AddCustomContentCenterPart Method&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That method is asking for a lot of information, so you would most likely have to prepare some variables ahead of time in previous lines of code, and set the values for them before the line of code for that method.&amp;nbsp; There are also a couple input parameter types that are unique to the iLogic add-in (not available in Inventor's API), so that can sometimes be a little confusing.&amp;nbsp; For instance the input named "position" (ninth input) is a&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=fb6039b8-323b-203f-5788-4c89e36b2ea7" target="_blank" rel="noopener"&gt;PointOrMatrix Interface&lt;/A&gt;.&amp;nbsp; It would seem like this is a compound Type, accepting either a&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=0265bff1-0386-6ddd-5ad1-d9cd0d6888c9" target="_blank" rel="noopener"&gt;DocumentUnitsMatrix&lt;/A&gt;&amp;nbsp;type object, or a&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=89eb92ee-7fc4-9b09-5465-a363bfcb12b5" target="_blank" rel="noopener"&gt;DocumentUnitsPoint&lt;/A&gt;&amp;nbsp;type object, instead of a regular &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-Matrix" target="_blank" rel="noopener"&gt;Matrix&lt;/A&gt; or &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-Point" target="_blank" rel="noopener"&gt;Point&lt;/A&gt; object.&amp;nbsp; Then the other optional input named "appearance" (twelfth input) is a&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=a2e2a91f-6aee-ebaa-ffef-838c3f8b6b75" target="_blank" rel="noopener"&gt;StringOrAsset&lt;/A&gt;&amp;nbsp;Type.&amp;nbsp; That Type's description is even more complicated, but it would seem like you could supply either the name (String) of an Asset, or an actual &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-Asset" target="_blank" rel="noopener"&gt;Asset&lt;/A&gt; object there.&amp;nbsp; &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-Assets" target="_blank" rel="noopener"&gt;Assets&lt;/A&gt; are basically used to store the data for things like Material, Appearance, Physical Properties of a material.&amp;nbsp; They can be obtained from either an external AssetLibrary, or from a Document object that has local copies in it (the Material &amp;amp; Appearance specs being used or stored within documents).&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 17:22:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/components-addcontentcenterpart/m-p/12384535#M16562</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-11-17T17:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Components.AddContentCenterPart</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/components-addcontentcenterpart/m-p/12384740#M16563</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp; Thanks for taking the time to reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was looking though the documentation yesterday night but I couldn't figure out a way to make it work. Today with a bit of fresh energy I have found a solution.&lt;/P&gt;&lt;P&gt;First, I've created a custom parameter in the family table just to give "customValues As Object()" something to change, it does not drive anything.&lt;/P&gt;&lt;P&gt;Here is the rest&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAsmName&lt;/SPAN&gt; = &lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt;.&lt;SPAN&gt;DisplayName&lt;/SPAN&gt;.&lt;SPAN&gt;Replace&lt;/SPAN&gt;(&lt;SPAN&gt;".iam"&lt;/SPAN&gt;, &lt;SPAN&gt;""&lt;/SPAN&gt;)
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPath&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Path&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oFolderName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; =&lt;SPAN&gt;"Components"&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oFolder&lt;/SPAN&gt; = &lt;SPAN&gt;oPath&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"\"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oFolderName&lt;/SPAN&gt; 
        &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Not&lt;/SPAN&gt; &lt;SPAN&gt;System&lt;/SPAN&gt;.&lt;SPAN&gt;IO&lt;/SPAN&gt;.&lt;SPAN&gt;Directory&lt;/SPAN&gt;.&lt;SPAN&gt;Exists&lt;/SPAN&gt;(&lt;SPAN&gt;oFolder&lt;/SPAN&gt;) &lt;SPAN&gt;Then&lt;/SPAN&gt;
            &lt;SPAN&gt;System&lt;/SPAN&gt;.&lt;SPAN&gt;IO&lt;/SPAN&gt;.&lt;SPAN&gt;Directory&lt;/SPAN&gt;.&lt;SPAN&gt;CreateDirectory&lt;/SPAN&gt;(&lt;SPAN&gt;oFolder&lt;/SPAN&gt;)
        &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN&gt;If TopPlate_Bespoke = True Then&lt;BR /&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;Top_plate&lt;/SPAN&gt; = &lt;SPAN&gt;Components&lt;/SPAN&gt;.&lt;SPAN&gt;AddCustomContentCenterPart&lt;/SPAN&gt;(&lt;SPAN&gt;"Top plate"&lt;/SPAN&gt;,
                                                &lt;SPAN&gt;"Plates:Rack unit plates"&lt;/SPAN&gt;,
                                                &lt;SPAN&gt;"Top Plate"&lt;/SPAN&gt;,
                                                {&lt;SPAN&gt;"Member"&lt;/SPAN&gt;, &lt;SPAN&gt;"Top Plate-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;Colour&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;Type&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;Depth&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"x"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;Type_Dim&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;" mm"&lt;/SPAN&gt; },
						{&lt;SPAN&gt;"Cparam"&lt;/SPAN&gt;, &lt;SPAN&gt;"1"&lt;/SPAN&gt; },
						&lt;SPAN&gt;asCustom&lt;/SPAN&gt; := &lt;SPAN&gt;True&lt;/SPAN&gt;, &lt;SPAN&gt;partFolder&lt;/SPAN&gt; := &lt;SPAN&gt;oFolder&lt;/SPAN&gt;, &lt;SPAN&gt;partFilename&lt;/SPAN&gt; := &lt;SPAN&gt;"Top Plate"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oAsmName&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;".ipt"&lt;/SPAN&gt;)&lt;BR /&gt;End If &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Hope it makes some sense&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 19:17:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/components-addcontentcenterpart/m-p/12384740#M16563</guid>
      <dc:creator>florescu.d95</dc:creator>
      <dc:date>2023-11-17T19:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Components.AddContentCenterPart</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/components-addcontentcenterpart/m-p/12387479#M16564</link>
      <description>&lt;P&gt;Just noticed something with the code above.&lt;/P&gt;&lt;P&gt;Som&amp;nbsp; etimes it works and sometimes it throws this:&lt;/P&gt;&lt;P&gt;Error on line 29 in rule: Config rule 2, in document:&amp;nbsp; Unit assembly template.iam&lt;/P&gt;&lt;P&gt;The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&lt;/P&gt;&lt;P&gt;Line 29 being :&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;Top_plate&lt;/SPAN&gt; = &lt;SPAN&gt;Components&lt;/SPAN&gt;.&lt;SPAN&gt;AddCustomContentCenterPart&lt;/SPAN&gt;(&lt;SPAN&gt;"Top plate"&lt;/SPAN&gt;,&lt;/PRE&gt;&lt;P&gt;Then if i restart Inventor it works.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Nov 2023 23:01:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/components-addcontentcenterpart/m-p/12387479#M16564</guid>
      <dc:creator>florescu.d95</dc:creator>
      <dc:date>2023-11-19T23:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Components.AddContentCenterPart</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/components-addcontentcenterpart/m-p/12388575#M16565</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10187446"&gt;@florescu.d95&lt;/a&gt;.&amp;nbsp; That error basically means that it was not able to use one of the inputs you supplied into that&amp;nbsp;AddCustomContentCenterPart method, for one reason or another.&amp;nbsp; The first possibility that come to mind is that there is already a component present in the assembly with that same exact name, and it will not allow two components to have exactly the same name.&amp;nbsp; That is why it always puts something like ":1" after the component name when they are added manually.&amp;nbsp; I believe that when adding components into an assembly by code, it lacks the user interaction required for the automatic rename utility catch and react to, so it does not rename stuff created that way.&amp;nbsp; Another theory is that a model file with the same path and name as that line of code generates may already exist, and it may not want to overwrite that existing file.&amp;nbsp; Or, perhaps the simple act of overwriting an existing file is not the problem, but maybe it will not allow you to overwrite the file if a reference to that file is currently being held in Inventor's session memory for some reason.&amp;nbsp; If that file was just created during your current session of Inventor, and maybe even while the same assembly was still open, then it is possible that a reference to that may still exist in Inventor's session memory.&amp;nbsp; If that is the case, then one other thing comes to mind that may be able to help.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;ThisApplication.Documents.CloseAll(True)&lt;/LI-CODE&gt;
&lt;P&gt;The 'True' in that line specifies that it should only clear out all of the unreferenced documents being held in Inventor's session memory, and not to close any documents that are still being actively referenced by open assemblies or drawings.&amp;nbsp; This is a good tool to help performance when looping through many file/document references.&amp;nbsp; It is often used together with the Document.ReleaseReference method, which is used to get rid of references to documents that were opened invisibly (in the background), and are not being used by anything else.&lt;/P&gt;
&lt;P&gt;Not sure if any of these may be the cause, or if any of these suggestions may help, but just throwing out some stuff that comes to mind, in case it may help.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 13:22:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/components-addcontentcenterpart/m-p/12388575#M16565</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-11-20T13:22:45Z</dc:date>
    </item>
  </channel>
</rss>

