<?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: Changing derived part with ilogic in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/changing-derived-part-with-ilogic/m-p/9288728#M67101</link>
    <description>&lt;P&gt;Maybe you could try it this way.&amp;nbsp; It's more code, but if it works...&lt;/P&gt;&lt;PRE&gt;Dim oDoc As PartDocument = ThisApplication.ActiveDocument
Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition
Dim oRefComps As ReferenceComponents = oDef.ReferenceComponents
For Each oRefComp As ReferenceComponent In oRefComps
	If oRefComp.Name = "Name Here" Then
		oRefComp.ReferencedDocumentDescriptor.ReferencedFileDescriptor.ReplaceReference("FullFileNameAndExtension")
	End If
Next&lt;/PRE&gt;</description>
    <pubDate>Fri, 31 Jan 2020 16:11:46 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2020-01-31T16:11:46Z</dc:date>
    <item>
      <title>Changing derived part with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/changing-derived-part-with-ilogic/m-p/9288485#M67099</link>
      <description>&lt;P&gt;I'm trying to change which part my part is being derived from using this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN&gt;File&lt;/SPAN&gt;.&lt;SPAN&gt;ReferencedFileDescriptors&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(1).&lt;SPAN&gt;ReplaceReference&lt;/SPAN&gt;(&lt;SPAN&gt;"FullFileNameAndExtension"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;...but i keep getting the Error "the parameter is incorrect". I've checked my FullFileNameAndExtension is correct by using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;Documents&lt;/SPAN&gt;.&lt;SPAN&gt;Open&lt;/SPAN&gt;("&lt;SPAN&gt;FullFileNameAndExtension"&lt;/SPAN&gt;, &lt;SPAN&gt;True&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... and this opens the new part fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also checked that the following is not nothing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN&gt;File&lt;/SPAN&gt;.&lt;SPAN&gt;ReferencedFileDescriptors&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...and it is something!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am i doing wrong?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 14:51:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/changing-derived-part-with-ilogic/m-p/9288485#M67099</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-31T14:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Changing derived part with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/changing-derived-part-with-ilogic/m-p/9288711#M67100</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is the new referenced file a copy of the old referenced file?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I might be mistaken (its been a while) but I think you might get an error if you try to replace the "bolt with the battleship", but you can replace the "bolt with another bolt" or "battleship with another battleship"....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe just something to rule out, or verify... but again I might be mis-remembering this, so hopefully I'm not creating confusion if I'm wrong&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 16:06:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/changing-derived-part-with-ilogic/m-p/9288711#M67100</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2020-01-31T16:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Changing derived part with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/changing-derived-part-with-ilogic/m-p/9288728#M67101</link>
      <description>&lt;P&gt;Maybe you could try it this way.&amp;nbsp; It's more code, but if it works...&lt;/P&gt;&lt;PRE&gt;Dim oDoc As PartDocument = ThisApplication.ActiveDocument
Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition
Dim oRefComps As ReferenceComponents = oDef.ReferenceComponents
For Each oRefComp As ReferenceComponent In oRefComps
	If oRefComp.Name = "Name Here" Then
		oRefComp.ReferencedDocumentDescriptor.ReferencedFileDescriptor.ReplaceReference("FullFileNameAndExtension")
	End If
Next&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Jan 2020 16:11:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/changing-derived-part-with-ilogic/m-p/9288728#M67101</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-01-31T16:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Changing derived part with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/changing-derived-part-with-ilogic/m-p/9288755#M67102</link>
      <description>&lt;P&gt;Or more accurately like this&lt;/P&gt;&lt;PRE&gt;Dim oDoc As PartDocument = ThisApplication.ActiveDocument
Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition
Dim oDPComps As DerivedPartComponents = oDef.ReferenceComponents.DerivedPartComponents
For Each oDPComp As DerivedPartComponent In oDPComps
	If oDPComp.Name = "Name Here" Then
		oDPComp.ReferencedDocumentDescriptor.ReferencedFileDescriptor.ReplaceReference("FullFileNameAndExtension")
	End If
Next&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Jan 2020 16:23:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/changing-derived-part-with-ilogic/m-p/9288755#M67102</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-01-31T16:23:05Z</dc:date>
    </item>
  </channel>
</rss>

