<?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: Derived Component names in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/derived-component-names/m-p/8014204#M84545</link>
    <description>&lt;P&gt;Current workaround now is to compare these two:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;System.IO.Path.GetFileNameWithoutExtension(Document.FullFileName)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;System.IO.Path.GetFileNameWithoutExtension(DerivedPartComponent.ReferencedDocumentDescriptor.FullDocumentName)&lt;/P&gt;</description>
    <pubDate>Sun, 20 May 2018 18:27:34 GMT</pubDate>
    <dc:creator>DonStauffer99</dc:creator>
    <dc:date>2018-05-20T18:27:34Z</dc:date>
    <item>
      <title>Derived Component names</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/derived-component-names/m-p/8013781#M84531</link>
      <description>&lt;P&gt;Is there a way to change the names of the parts in the browser of a derived part? Randomly, some of them have gotten .ipt on the end of them, like filenames, but not all of them. This messes me up when I try to look up a derived component in code. For example, this code:&lt;BR /&gt;&lt;BR /&gt;SyntaxEditor Code Snippet&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #008cff;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;dpcs&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;DerivedPartComponents&lt;/SPAN&gt;
&lt;SPAN style="color: #000000;"&gt;dpcs&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #000000;"&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN style="color: #000000;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #000000;"&gt;ReferenceComponents&lt;/SPAN&gt;.&lt;SPAN style="color: #000000;"&gt;DerivedPartComponents&lt;/SPAN&gt;

&lt;SPAN style="color: #008cff;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #008cff;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;i&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Integer&lt;/SPAN&gt; = 0

&lt;SPAN style="color: #008cff;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;dpc&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;DerivedPartComponent&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;dpcs&lt;/SPAN&gt;
	&lt;SPAN style="color: #000000;"&gt;i&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;i&lt;/SPAN&gt; + 1
	&lt;SPAN style="color: #008cff;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;i&lt;/SPAN&gt; &amp;gt; 1 &lt;SPAN style="color: #008cff;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #000000;"&gt;Chr&lt;/SPAN&gt;(10)
	&lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #000000;"&gt;dpc&lt;/SPAN&gt;.&lt;SPAN style="color: #000000;"&gt;Name&lt;/SPAN&gt; 
&lt;SPAN style="color: #008cff;"&gt;Next&lt;/SPAN&gt;

&lt;SPAN style="color: #000000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Produces the results in the attached screen shot: some of the parts have .ipt extensions, and some don't. Nothing I've tried has enabled me to change the names. The Name property of DerivedPartComponents is read-only, too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 20 May 2018 06:44:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/derived-component-names/m-p/8013781#M84531</guid>
      <dc:creator>DonStauffer99</dc:creator>
      <dc:date>2018-05-20T06:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Derived Component names</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/derived-component-names/m-p/8013814#M84532</link>
      <description>I have tried that too for a while and I think this is not possible. Maybe this is something for idea station.</description>
      <pubDate>Sun, 20 May 2018 07:56:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/derived-component-names/m-p/8013814#M84532</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2018-05-20T07:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Derived Component names</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/derived-component-names/m-p/8014141#M84540</link>
      <description>&lt;P&gt;I did some experimenting. I think part of the problem is that I've changed part names a few times. For example, I have a part named Front Right Joint. That's what the document DisplayName shows. Using this script on it gives different results depending on whether parts are loaded or not, and whether the link is suppressed or not, in 2 ways: 1. Sometimes the RefDoc.DisplayName is Nothing; 2. Sometimes the Descriptor.DisplayName comes back as "Front Right Side Joint", which is a name the part used to have.&lt;BR /&gt;&lt;BR /&gt;So, to summarize, dpc.Name sometimes has the file extension on it, Descriptor.DisplayName sometimes has an old part name in it, and RefDoc is sometimes Nothing. So none of these will reliably identify the DerivedPartComponent I want by DisplayName. I could use string functions to strip off the .ipt, but I want a robust solution and that seems fragile.&lt;BR /&gt;&lt;BR /&gt;SyntaxEditor Code Snippet&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #008cff;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;dpcs&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;DerivedPartComponents&lt;/SPAN&gt;
&lt;SPAN style="color: #000000;"&gt;dpcs&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #000000;"&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN style="color: #000000;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #000000;"&gt;ReferenceComponents&lt;/SPAN&gt;.&lt;SPAN style="color: #000000;"&gt;DerivedPartComponents&lt;/SPAN&gt;

&lt;SPAN style="color: #008cff;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;Descriptor&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;DocumentDescriptor&lt;/SPAN&gt;
&lt;SPAN style="color: #008cff;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;RefDoc&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;Document&lt;/SPAN&gt;

&lt;SPAN style="color: #008cff;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #008cff;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;i&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Integer&lt;/SPAN&gt; = 0

&lt;SPAN style="color: #008cff;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;dpc&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;DerivedPartComponent&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;dpcs&lt;/SPAN&gt;
	
	&lt;SPAN style="color: #000000;"&gt;i&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;i&lt;/SPAN&gt; + 1
	
	&lt;SPAN style="color: #008cff;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;i&lt;/SPAN&gt; &amp;gt; 1 &lt;SPAN style="color: #008cff;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #000000;"&gt;Chr&lt;/SPAN&gt;(10) &amp;amp; &lt;SPAN style="color: #000000;"&gt;CHR&lt;/SPAN&gt;(10)
		
	&lt;SPAN style="color: #008cff;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;dpc&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Nothing&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Then&lt;/SPAN&gt;
		&lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #000000;"&gt;Chr&lt;/SPAN&gt;(10) &amp;amp; &lt;SPAN style="color: #800000;"&gt;"dpc Is Nothing"&lt;/SPAN&gt;
		&lt;SPAN style="color: #008cff;"&gt;Continue&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;For&lt;/SPAN&gt;
	&lt;SPAN style="color: #008cff;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;If&lt;/SPAN&gt;
		
	&lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;"Dpc.Name="&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #000000;"&gt;dpc&lt;/SPAN&gt;.&lt;SPAN style="color: #000000;"&gt;Name&lt;/SPAN&gt; 

    &lt;SPAN style="color: #000000;"&gt;Descriptor&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;dpc&lt;/SPAN&gt;.&lt;SPAN style="color: #000000;"&gt;ReferencedDocumentDescriptor&lt;/SPAN&gt;
	
	&lt;SPAN style="color: #008cff;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;Descriptor&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Nothing&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Then&lt;/SPAN&gt;
		&lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #000000;"&gt;Chr&lt;/SPAN&gt;(10) &amp;amp; &lt;SPAN style="color: #800000;"&gt;"dpc Is Nothing"&lt;/SPAN&gt;
		&lt;SPAN style="color: #008cff;"&gt;Continue&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;For&lt;/SPAN&gt;
	&lt;SPAN style="color: #008cff;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;If&lt;/SPAN&gt;

	&lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #000000;"&gt;Chr&lt;/SPAN&gt;(10) &amp;amp; &lt;SPAN style="color: #800000;"&gt;" Descriptor.DisplayName="&lt;/SPAN&gt; _
			&amp;amp; &lt;SPAN style="color: #000000;"&gt;Descriptor&lt;/SPAN&gt;.&lt;SPAN style="color: #000000;"&gt;DisplayName&lt;/SPAN&gt; 

	&lt;SPAN style="color: #000000;"&gt;RefDoc&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;Descriptor&lt;/SPAN&gt;.&lt;SPAN style="color: #000000;"&gt;ReferencedDocument&lt;/SPAN&gt;
	
	&lt;SPAN style="color: #008cff;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;RefDoc&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Nothing&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Then&lt;/SPAN&gt;
		&lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #000000;"&gt;Chr&lt;/SPAN&gt;(10) &amp;amp; &lt;SPAN style="color: #800000;"&gt;"RefDoc Is Nothing"&lt;/SPAN&gt;
		&lt;SPAN style="color: #008cff;"&gt;Continue&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;For&lt;/SPAN&gt;
	&lt;SPAN style="color: #008cff;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;If&lt;/SPAN&gt;
	
	&lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #000000;"&gt;Chr&lt;/SPAN&gt;(10) &amp;amp; &lt;SPAN style="color: #800000;"&gt;" RefDoc.DisplayName="&lt;/SPAN&gt; _
			&amp;amp; &lt;SPAN style="color: #000000;"&gt;RefDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #000000;"&gt;DisplayName&lt;/SPAN&gt;
	
&lt;SPAN style="color: #008cff;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #000000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #000000;"&gt;s&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 20 May 2018 16:41:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/derived-component-names/m-p/8014141#M84540</guid>
      <dc:creator>DonStauffer99</dc:creator>
      <dc:date>2018-05-20T16:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Derived Component names</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/derived-component-names/m-p/8014160#M84542</link>
      <description>&lt;P&gt;I was able to work around this by comparing Document.FullFileName to ReferencedDocumentDescriptor.FullDocumentName.&lt;BR /&gt;&lt;BR /&gt;I wasn't sure if I should have used Document.FullDocumentName instead, because the property names would be the same. But going by the documentation, the descriptions of these two were the same and the descriptions of the ones with the same property names were oddly not the same. But all 3 seemed to produce the same string for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not entirely satisfied this workaround won't break under some circumstances, though.&lt;/P&gt;</description>
      <pubDate>Sun, 20 May 2018 17:14:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/derived-component-names/m-p/8014160#M84542</guid>
      <dc:creator>DonStauffer99</dc:creator>
      <dc:date>2018-05-20T17:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Derived Component names</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/derived-component-names/m-p/8014186#M84543</link>
      <description>&lt;P&gt;I was right. It broke.&lt;BR /&gt;&lt;BR /&gt;ReferencedDocumentDescriptor.FullDocumentName gave an old filespec with a different directory on one of the parts.&lt;BR /&gt;&lt;BR /&gt;It seems like ReferencedDocumentDescriptor properties don't ever update themselves; then when a link is suppressed, they dredge up ancient history instead of the last known values. This is really unhelpful.&lt;/P&gt;&lt;P&gt;If I have a suppressed derivation to a part, I need to be able to reliably find the correct DerivedPartComponent for it. Otherwise how can I un-suppress it in code?&lt;/P&gt;</description>
      <pubDate>Sun, 20 May 2018 17:58:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/derived-component-names/m-p/8014186#M84543</guid>
      <dc:creator>DonStauffer99</dc:creator>
      <dc:date>2018-05-20T17:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Derived Component names</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/derived-component-names/m-p/8014188#M84544</link>
      <description>&lt;P&gt;Please don't say "re-derive the part". With the stuff that's built on it, that would be hellish. I'd have to recreate the whole project from scratch - something I've already had to do a dozen times or more. That's one of the worst things about Inventor.&lt;/P&gt;</description>
      <pubDate>Sun, 20 May 2018 18:00:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/derived-component-names/m-p/8014188#M84544</guid>
      <dc:creator>DonStauffer99</dc:creator>
      <dc:date>2018-05-20T18:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Derived Component names</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/derived-component-names/m-p/8014204#M84545</link>
      <description>&lt;P&gt;Current workaround now is to compare these two:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;System.IO.Path.GetFileNameWithoutExtension(Document.FullFileName)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;System.IO.Path.GetFileNameWithoutExtension(DerivedPartComponent.ReferencedDocumentDescriptor.FullDocumentName)&lt;/P&gt;</description>
      <pubDate>Sun, 20 May 2018 18:27:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/derived-component-names/m-p/8014204#M84545</guid>
      <dc:creator>DonStauffer99</dc:creator>
      <dc:date>2018-05-20T18:27:34Z</dc:date>
    </item>
  </channel>
</rss>

