<?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: Retrieve parent component iProperties in a derived/child component in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-parent-component-iproperties-in-a-derived-child/m-p/10301360#M124226</link>
    <description>&lt;P&gt;The two of these sources were useful for researching this.&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/ilogic-rule-to-include-exclude-derived-parameter-in-all-parts/td-p/8691196" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/inventor-customization/ilogic-rule-to-include-exclude-derived-parameter-in-all-parts/td-p/8691196&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This one is more in depth copying all iProperties or selected iProperties,&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/derived-part-to-copy-multiple-selected-custom-iproperties-from/td-p/8742936" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/inventor-customization/derived-part-to-copy-multiple-selected-custom-iproperties-from/td-p/8742936&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However the selected iProperties failed to run for me&amp;nbsp; so I created the below to just target the iProperty you requested.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; &amp;lt;&amp;gt; &lt;SPAN&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
	&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"Make a Part Document the active document,Exiting"&lt;/SPAN&gt;, &lt;SPAN&gt;"iLogic"&lt;/SPAN&gt;) 
&lt;SPAN&gt;Else&lt;/SPAN&gt;

	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDerDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&lt;/SPAN&gt;
	&lt;SPAN&gt;oDerDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;

	&lt;SPAN&gt;'Look for Derived part components&lt;/SPAN&gt;
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oDerDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;ReferenceComponents&lt;/SPAN&gt;.&lt;SPAN&gt;DerivedPartComponents&lt;/SPAN&gt;.&lt;SPAN&gt;Count&lt;/SPAN&gt; &amp;lt; 1 &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"No Derived Part Components in this part"&lt;/SPAN&gt;, &lt;SPAN&gt;"iLogic"&lt;/SPAN&gt;)   

	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;oDerDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;ReferenceComponents&lt;/SPAN&gt;.&lt;SPAN&gt;DerivedPartComponents&lt;/SPAN&gt;.&lt;SPAN&gt;Count&lt;/SPAN&gt; &amp;gt; 1 &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"More than one Derived Part Components in this part,Exiting!"&lt;/SPAN&gt;, &lt;SPAN&gt;"iLogic"&lt;/SPAN&gt;) 
	&lt;SPAN&gt;Else&lt;/SPAN&gt;
		
		&lt;SPAN&gt;' Set a reference to the part component definition&lt;/SPAN&gt;
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDerCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartComponentDefinition&lt;/SPAN&gt;
		&lt;SPAN&gt;oDerCompDef&lt;/SPAN&gt; = &lt;SPAN&gt;oDerDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
		
		&lt;SPAN&gt;'Get a reference to derived part components in this part&lt;/SPAN&gt;
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDerComps&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DerivedPartComponents&lt;/SPAN&gt;
		&lt;SPAN&gt;oDerComps&lt;/SPAN&gt; = &lt;SPAN&gt;oDerCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;ReferenceComponents&lt;/SPAN&gt;.&lt;SPAN&gt;DerivedPartComponents&lt;/SPAN&gt;
		
		&lt;SPAN&gt;'Get a reference to derived part component&lt;/SPAN&gt;
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDerComp&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DerivedPartComponent&lt;/SPAN&gt;
		&lt;SPAN&gt;oDerComp&lt;/SPAN&gt; = &lt;SPAN&gt;oDerComps&lt;/SPAN&gt;(1)&lt;SPAN&gt;'1st component&lt;/SPAN&gt;
		&lt;SPAN&gt;'MessageBox.Show(oDerComp.Name, "iLogic")&lt;/SPAN&gt;
		
		&lt;SPAN&gt;' Get the Reference document.&lt;/SPAN&gt;
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oRefDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt;
		&lt;SPAN&gt;oRefDoc&lt;/SPAN&gt; = &lt;SPAN&gt;oDerComp&lt;/SPAN&gt;.&lt;SPAN&gt;ReferencedDocumentDescriptor&lt;/SPAN&gt;.&lt;SPAN&gt;ReferencedDocument&lt;/SPAN&gt;
		&lt;BR /&gt;                'Creates the iProperty in the derived part and assigns the iProperty value of the refDoc
		&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"ParentPartNumber"&lt;/SPAN&gt;) = &lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;oRefDoc&lt;/SPAN&gt;.&lt;SPAN&gt;DisplayName&lt;/SPAN&gt;,&lt;SPAN&gt;"Project"&lt;/SPAN&gt;, &lt;SPAN&gt;"Part Number"&lt;/SPAN&gt;)
		&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"iProperty Copied from Parent to Child"&lt;/SPAN&gt;, &lt;SPAN&gt;"Success"&lt;/SPAN&gt;)
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;	    &lt;/PRE&gt;&lt;P&gt;I hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 09 May 2021 21:36:02 GMT</pubDate>
    <dc:creator>A.Acheson</dc:creator>
    <dc:date>2021-05-09T21:36:02Z</dc:date>
    <item>
      <title>Retrieve parent component iProperties in a derived/child component</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-parent-component-iproperties-in-a-derived-child/m-p/10289940#M124076</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to retrieve the part number of the parent component in a derived child component through ilogic, and then pass this to a custom iproperty in the child component.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The parent is the raw material, which is then machined to produce the child. I would like to be able to pull in the part number of the parent to then populate a field in the drawing of the machined part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using Inventor 2022.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 15:28:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-parent-component-iproperties-in-a-derived-child/m-p/10289940#M124076</guid>
      <dc:creator>gharveyMHN58</dc:creator>
      <dc:date>2021-05-04T15:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve parent component iProperties in a derived/child component</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-parent-component-iproperties-in-a-derived-child/m-p/10301360#M124226</link>
      <description>&lt;P&gt;The two of these sources were useful for researching this.&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/ilogic-rule-to-include-exclude-derived-parameter-in-all-parts/td-p/8691196" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/inventor-customization/ilogic-rule-to-include-exclude-derived-parameter-in-all-parts/td-p/8691196&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This one is more in depth copying all iProperties or selected iProperties,&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/derived-part-to-copy-multiple-selected-custom-iproperties-from/td-p/8742936" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/inventor-customization/derived-part-to-copy-multiple-selected-custom-iproperties-from/td-p/8742936&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However the selected iProperties failed to run for me&amp;nbsp; so I created the below to just target the iProperty you requested.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; &amp;lt;&amp;gt; &lt;SPAN&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
	&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"Make a Part Document the active document,Exiting"&lt;/SPAN&gt;, &lt;SPAN&gt;"iLogic"&lt;/SPAN&gt;) 
&lt;SPAN&gt;Else&lt;/SPAN&gt;

	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDerDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&lt;/SPAN&gt;
	&lt;SPAN&gt;oDerDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;

	&lt;SPAN&gt;'Look for Derived part components&lt;/SPAN&gt;
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oDerDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;ReferenceComponents&lt;/SPAN&gt;.&lt;SPAN&gt;DerivedPartComponents&lt;/SPAN&gt;.&lt;SPAN&gt;Count&lt;/SPAN&gt; &amp;lt; 1 &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"No Derived Part Components in this part"&lt;/SPAN&gt;, &lt;SPAN&gt;"iLogic"&lt;/SPAN&gt;)   

	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;oDerDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;ReferenceComponents&lt;/SPAN&gt;.&lt;SPAN&gt;DerivedPartComponents&lt;/SPAN&gt;.&lt;SPAN&gt;Count&lt;/SPAN&gt; &amp;gt; 1 &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"More than one Derived Part Components in this part,Exiting!"&lt;/SPAN&gt;, &lt;SPAN&gt;"iLogic"&lt;/SPAN&gt;) 
	&lt;SPAN&gt;Else&lt;/SPAN&gt;
		
		&lt;SPAN&gt;' Set a reference to the part component definition&lt;/SPAN&gt;
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDerCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartComponentDefinition&lt;/SPAN&gt;
		&lt;SPAN&gt;oDerCompDef&lt;/SPAN&gt; = &lt;SPAN&gt;oDerDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
		
		&lt;SPAN&gt;'Get a reference to derived part components in this part&lt;/SPAN&gt;
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDerComps&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DerivedPartComponents&lt;/SPAN&gt;
		&lt;SPAN&gt;oDerComps&lt;/SPAN&gt; = &lt;SPAN&gt;oDerCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;ReferenceComponents&lt;/SPAN&gt;.&lt;SPAN&gt;DerivedPartComponents&lt;/SPAN&gt;
		
		&lt;SPAN&gt;'Get a reference to derived part component&lt;/SPAN&gt;
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDerComp&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DerivedPartComponent&lt;/SPAN&gt;
		&lt;SPAN&gt;oDerComp&lt;/SPAN&gt; = &lt;SPAN&gt;oDerComps&lt;/SPAN&gt;(1)&lt;SPAN&gt;'1st component&lt;/SPAN&gt;
		&lt;SPAN&gt;'MessageBox.Show(oDerComp.Name, "iLogic")&lt;/SPAN&gt;
		
		&lt;SPAN&gt;' Get the Reference document.&lt;/SPAN&gt;
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oRefDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt;
		&lt;SPAN&gt;oRefDoc&lt;/SPAN&gt; = &lt;SPAN&gt;oDerComp&lt;/SPAN&gt;.&lt;SPAN&gt;ReferencedDocumentDescriptor&lt;/SPAN&gt;.&lt;SPAN&gt;ReferencedDocument&lt;/SPAN&gt;
		&lt;BR /&gt;                'Creates the iProperty in the derived part and assigns the iProperty value of the refDoc
		&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"ParentPartNumber"&lt;/SPAN&gt;) = &lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;oRefDoc&lt;/SPAN&gt;.&lt;SPAN&gt;DisplayName&lt;/SPAN&gt;,&lt;SPAN&gt;"Project"&lt;/SPAN&gt;, &lt;SPAN&gt;"Part Number"&lt;/SPAN&gt;)
		&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"iProperty Copied from Parent to Child"&lt;/SPAN&gt;, &lt;SPAN&gt;"Success"&lt;/SPAN&gt;)
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;	    &lt;/PRE&gt;&lt;P&gt;I hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 May 2021 21:36:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-parent-component-iproperties-in-a-derived-child/m-p/10301360#M124226</guid>
      <dc:creator>A.Acheson</dc:creator>
      <dc:date>2021-05-09T21:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve parent component iProperties in a derived/child component</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-parent-component-iproperties-in-a-derived-child/m-p/10301962#M124237</link>
      <description>&lt;P&gt;Thank you, that's perfect, does exactly what I was looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 07:27:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-parent-component-iproperties-in-a-derived-child/m-p/10301962#M124237</guid>
      <dc:creator>gharveyMHN58</dc:creator>
      <dc:date>2021-05-10T07:27:38Z</dc:date>
    </item>
  </channel>
</rss>

