<?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 part material in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9332075#M129497</link>
    <description>&lt;P&gt;Both ways worked perfectly! Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could the code be tweaked so it would physically match the material from the parent rather the just display the parent in a message box?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Feb 2020 21:37:39 GMT</pubDate>
    <dc:creator>Formsprag</dc:creator>
    <dc:date>2020-02-20T21:37:39Z</dc:date>
    <item>
      <title>derived part material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/4333563#M129488</link>
      <description>&lt;P&gt;is it possible to get the material of the derived part in vba ?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2013 18:45:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/4333563#M129488</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-17T18:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: derived part material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/4333701#M129489</link>
      <description>&lt;P&gt;I might be missing it, but I looked around the VBA locals and couldn't find material for the Derived part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;F8 through this code and look at locals (View &amp;gt; Locals Window)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Normally you'd find it under the&amp;nbsp;Definition section...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public Sub FindDer()
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument
    Dim oDerPartComp As DerivedPartComponent
    Set oDerPartComp = oDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.Item(1)
    MsgBox ("Found " &amp;amp; oDerPartComp.name)
End Sub&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Jul 2013 20:44:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/4333701#M129489</guid>
      <dc:creator>jdkriek</dc:creator>
      <dc:date>2013-07-17T20:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: derived part material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/4333892#M129490</link>
      <description>&lt;PRE&gt;Public Sub Derived_Material()
    Dim oPartDoc As PartDocument
    Set oPartDoc = ThisApplication.ActiveDocument
    
    Dim oderivedPart As DerivedPartComponent
    Set oderivedPart = oPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.Item(1)
    
    Dim oRefPart As PartDocument
    Set oRefPart = oderivedPart.ReferencedDocumentDescriptor.ReferencedDocument
    
    Dim oRefPartDef As PartComponentDefinition
    Set oRefPartDef = oRefPart.ComponentDefinition
            
    Dim oMaterial As Material
    Set oMaterial = oRefPartDef.Material
    
    MsgBox (oMaterial.Name)
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 02:32:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/4333892#M129490</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-18T02:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: derived part material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/4334703#M129491</link>
      <description>&lt;P&gt;That's interesting; the locals never show access to the material.&amp;nbsp;I had originally assumed that it was accessed the same way as any other part, but Intellisense never picked it up and locals never dropped down to that scope in the definition.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 12:47:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/4334703#M129491</guid>
      <dc:creator>jdkriek</dc:creator>
      <dc:date>2013-07-18T12:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: derived part material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/4335173#M129492</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;jd &amp;amp; sassen....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you guys....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;works perfectly....&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 17:53:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/4335173#M129492</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-18T17:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: derived part material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9331839#M129493</link>
      <description>&lt;P&gt;I see this post was solved in 2013, is it still applicable in 2020? I get an error when I try in to 2020. Any input would be helpful!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 19:56:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9331839#M129493</guid>
      <dc:creator>Formsprag</dc:creator>
      <dc:date>2020-02-20T19:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: derived part material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9331856#M129494</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3828681"&gt;@Formsprag&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did a quick test with Inventor 2020.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran this on a derived part and it showed me the material of the part from which it was derived without issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just to confirm, the part referenced in your derived part is a part file rather than an assembly, right?&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 20:04:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9331856#M129494</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2020-02-20T20:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: derived part material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9332007#M129495</link>
      <description>&lt;P&gt;Yes it is a part file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the error I get.....&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2020-02-20_16-05-05.jpg" style="width: 340px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/732361iEEC671E88F75E1A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="2020-02-20_16-05-05.jpg" alt="2020-02-20_16-05-05.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 21:08:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9332007#M129495</guid>
      <dc:creator>Formsprag</dc:creator>
      <dc:date>2020-02-20T21:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: derived part material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9332058#M129496</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3828681"&gt;@Formsprag&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ahh, okay the example posted in this thread was authored for VBA, so a bit of reformatting is need to run it in iLogic&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Firstly, you can do a search for "Set" and just replace it with nothing, and then secondly you can just remove the "Sub..." and "End Sub" lines like this or make the Sub line read "Sub Main"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so basically here are two versions that will run via ilogic:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Public Sub Main
    Dim oPartDoc As PartDocument
    oPartDoc = ThisApplication.ActiveDocument
    
    Dim oderivedPart As DerivedPartComponent
    oderivedPart = oPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.Item(1)
    
    Dim oRefPart As PartDocument
    oRefPart = oderivedPart.ReferencedDocumentDescriptor.ReferencedDocument
    
    Dim oRefPartDef As PartComponentDefinition
    oRefPartDef = oRefPart.ComponentDefinition
            
    Dim oMaterial As Material
    oMaterial = oRefPartDef.Material
    
    MsgBox (oMaterial.Name)
End Sub&lt;/PRE&gt;
&lt;P&gt;or&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;    Dim oPartDoc As PartDocument
    oPartDoc = ThisApplication.ActiveDocument
    
    Dim oderivedPart As DerivedPartComponent
    oderivedPart = oPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.Item(1)
    
    Dim oRefPart As PartDocument
    oRefPart = oderivedPart.ReferencedDocumentDescriptor.ReferencedDocument
    
    Dim oRefPartDef As PartComponentDefinition
    oRefPartDef = oRefPart.ComponentDefinition
            
    Dim oMaterial As Material
    oMaterial = oRefPartDef.Material
    
    MsgBox (oMaterial.Name)
&lt;/PRE&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" rel="noopener"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 21:34:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9332058#M129496</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2020-02-20T21:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: derived part material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9332075#M129497</link>
      <description>&lt;P&gt;Both ways worked perfectly! Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could the code be tweaked so it would physically match the material from the parent rather the just display the parent in a message box?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 21:37:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9332075#M129497</guid>
      <dc:creator>Formsprag</dc:creator>
      <dc:date>2020-02-20T21:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: derived part material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9332758#M129498</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could vote one of my ideas in the idea station:&lt;/P&gt;
&lt;P&gt;&lt;A style="background-color: #ffffff; outline: 0px;" href="https://forums.autodesk.com/t5/inventor-ideas/derived-part-and-assembly-copy-i-properties/idi-p/6349392" target="_blank"&gt;Derive I-properties!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 08:14:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9332758#M129498</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2020-02-21T08:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: derived part material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9333677#M129499</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3828681"&gt;@Formsprag&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Both ways worked perfectly! Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could the code be tweaked so it would physically match the material from the parent rather the just display the parent in a message box?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3828681"&gt;@Formsprag&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think this should do it.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument

Dim oderivedPart As DerivedPartComponent
oderivedPart = oPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.Item(1)

Dim oRefPart As PartDocument
oRefPart = oderivedPart.ReferencedDocumentDescriptor.ReferencedDocument

Dim oRefPartDef As PartComponentDefinition
oRefPartDef = oRefPart.ComponentDefinition
        
Dim oMaterial As Material
oMaterial = oRefPartDef.Material

Dim sMaterial As String
sMaterial = oMaterial.Name

iProperties.Material = sMaterial&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Feb 2020 15:12:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9333677#M129499</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2020-02-21T15:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: derived part material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9333802#M129500</link>
      <description>&lt;P&gt;That worked perfect! Thanks Curtis&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anyway to trigger the rule if the part is derived and ignored if not derived?&lt;/P&gt;&lt;P&gt;I tried to simply use the Event Triggers hoping the rule would be ignored if it didn't detect the parent file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 16:04:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9333802#M129500</guid>
      <dc:creator>Formsprag</dc:creator>
      <dc:date>2020-02-21T16:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: derived part material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9333913#M129501</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3828681"&gt;@Formsprag&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will catch the error when there is no derived component reference and just exit the rule, so the while it will still be triggered, the rule wont error out.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument

Dim oderivedPart As DerivedPartComponent
&lt;FONT color="#0000FF"&gt;Try&lt;/FONT&gt;
oderivedPart = oPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.Item(1)
&lt;FONT color="#0000FF"&gt;Catch
	Return 'exit rule
End Try&lt;/FONT&gt;

Dim oRefPart As PartDocument
oRefPart = oderivedPart.ReferencedDocumentDescriptor.ReferencedDocument

Dim oRefPartDef As PartComponentDefinition
oRefPartDef = oRefPart.ComponentDefinition
        
Dim oMaterial As Material
oMaterial = oRefPartDef.Material

Dim sMaterial As String
sMaterial = oMaterial.Name

iProperties.Material = sMaterial&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Feb 2020 16:43:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9333913#M129501</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2020-02-21T16:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: derived part material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9334018#M129502</link>
      <description>&lt;P&gt;Perfect! Thanks for your help....&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 17:37:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/derived-part-material/m-p/9334018#M129502</guid>
      <dc:creator>Formsprag</dc:creator>
      <dc:date>2020-02-21T17:37:06Z</dc:date>
    </item>
  </channel>
</rss>

