<?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 Get Part Parameter name from assembly in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-part-parameter-name-from-assembly/m-p/8832211#M98040</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;im trying to create a Function to find a part in my assembly and then find in it a parameter which can be a model or a user parameter.&lt;/P&gt;&lt;P&gt;But the farthest i could go is to look into assembly parameters....&lt;/P&gt;&lt;P&gt;Any Idea?&lt;BR /&gt;&lt;BR /&gt;Here is my code so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;----------------------------------&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Function&lt;/SPAN&gt; &lt;SPAN&gt;fuFindPartParam&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ByVal sVar1 as string, ByVal sVar2 as string, ByVal sVar3 as string&lt;/SPAN&gt;&lt;SPAN&gt;) as string&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Dim oDoc As AssemblyDocument&lt;BR /&gt;oDoc = ThisDoc.Document&lt;BR /&gt;Dim oComps As ComponentOccurrences&lt;BR /&gt;oComps = oDoc.ComponentDefinition.Occurrences&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;For Each oComp In oComps&lt;BR /&gt;&amp;nbsp; &amp;nbsp; If oComp.Name = sVar3 Then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For Each oParameter In oComp.Definition.Parameters.ModelParameters&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If oParameter.Name.Contains(sVar1) And oParameter.Name.Contains(sVar2) Then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Return oParameter.Name&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End If&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;BR /&gt;&amp;nbsp; &amp;nbsp; End If&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;For Each oComp In oComps&lt;BR /&gt;&amp;nbsp; &amp;nbsp; If oComp.Name = sVar3 Then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For Each oParameter In oComp.Definition.Parameters.UserParameters&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If oParameter.Name.Contains(sVar1) And oParameter.Name.Contains(sVar2) Then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Return oParameter.Name&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End If&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;BR /&gt;&amp;nbsp; &amp;nbsp; End If&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jun 2019 18:26:57 GMT</pubDate>
    <dc:creator>karl.leduc-berard</dc:creator>
    <dc:date>2019-06-04T18:26:57Z</dc:date>
    <item>
      <title>Get Part Parameter name from assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-part-parameter-name-from-assembly/m-p/8832211#M98040</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;im trying to create a Function to find a part in my assembly and then find in it a parameter which can be a model or a user parameter.&lt;/P&gt;&lt;P&gt;But the farthest i could go is to look into assembly parameters....&lt;/P&gt;&lt;P&gt;Any Idea?&lt;BR /&gt;&lt;BR /&gt;Here is my code so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;----------------------------------&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Function&lt;/SPAN&gt; &lt;SPAN&gt;fuFindPartParam&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ByVal sVar1 as string, ByVal sVar2 as string, ByVal sVar3 as string&lt;/SPAN&gt;&lt;SPAN&gt;) as string&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Dim oDoc As AssemblyDocument&lt;BR /&gt;oDoc = ThisDoc.Document&lt;BR /&gt;Dim oComps As ComponentOccurrences&lt;BR /&gt;oComps = oDoc.ComponentDefinition.Occurrences&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;For Each oComp In oComps&lt;BR /&gt;&amp;nbsp; &amp;nbsp; If oComp.Name = sVar3 Then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For Each oParameter In oComp.Definition.Parameters.ModelParameters&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If oParameter.Name.Contains(sVar1) And oParameter.Name.Contains(sVar2) Then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Return oParameter.Name&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End If&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;BR /&gt;&amp;nbsp; &amp;nbsp; End If&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;For Each oComp In oComps&lt;BR /&gt;&amp;nbsp; &amp;nbsp; If oComp.Name = sVar3 Then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For Each oParameter In oComp.Definition.Parameters.UserParameters&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If oParameter.Name.Contains(sVar1) And oParameter.Name.Contains(sVar2) Then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Return oParameter.Name&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End If&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;BR /&gt;&amp;nbsp; &amp;nbsp; End If&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 18:26:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-part-parameter-name-from-assembly/m-p/8832211#M98040</guid>
      <dc:creator>karl.leduc-berard</dc:creator>
      <dc:date>2019-06-04T18:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Get Part Parameter name from assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-part-parameter-name-from-assembly/m-p/8835653#M98112</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5986122"&gt;@karl.leduc-berard&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this below code may be helpful.&lt;/P&gt;
&lt;PRE&gt;Function fuFindPartParam(ByVal sVar1 As String, ByVal sVar2 As String, ByVal sVar3 As String) As String
 

Dim oDoc As AssemblyDocument
oDoc = ThisDoc.Document
Dim oComps As ComponentOccurrences
oComps = oDoc.ComponentDefinition.Occurrences


For Each oComp In oComps
    If oComp.Name = sVar3 Then
        For Each oParameter In oComp.Definition.Parameters 
             If oParameter.Name.Contains(sVar1) Or oParameter.Name.Contains(sVar2) Then
                   Return oParameter.Name
             End If
        Next
    End If
Next

 

End Function&lt;/PRE&gt;
&lt;P&gt;Thanks and regards&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 06:52:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-part-parameter-name-from-assembly/m-p/8835653#M98112</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2019-06-06T06:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get Part Parameter name from assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-part-parameter-name-from-assembly/m-p/8836150#M98125</link>
      <description>&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 12:06:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-part-parameter-name-from-assembly/m-p/8836150#M98125</guid>
      <dc:creator>karl.leduc-berard</dc:creator>
      <dc:date>2019-06-06T12:06:09Z</dc:date>
    </item>
  </channel>
</rss>

