<?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: Get Component in subassembly without iteration in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-component-in-subassembly-without-iteration/m-p/10129293#M121685</link>
    <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;I have not tested it yet!&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Public Sub Main
	
	Dim ass As Inventor.AssemblyDocument = ThisApplication.ActiveDocument
	Dim Occurrences As Inventor.ComponentOccurrences = ass.ComponentDefinition.Occurrences
	
'Dim occ As ComponentOccurrence
Dim assocc As Inventor.AssemblyDocument = ass.ComponentDefinition.Occurrences.ItemByName("MySubAssembly").Definition.Document
Dim PartOcc As Inventor.ComponentOccurrence = assocc.ComponentDefinition.Occurrences.ItemByName("MyComponent")

Dim p As Inventor.PartDocument =PartOcc.Definition.Document

End Sub&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Mar 2021 10:12:24 GMT</pubDate>
    <dc:creator>bradeneuropeArthur</dc:creator>
    <dc:date>2021-03-04T10:12:24Z</dc:date>
    <item>
      <title>Get Component in subassembly without iteration</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-component-in-subassembly-without-iteration/m-p/10129215#M121683</link>
      <description>&lt;P&gt;Inside my assembly I have a subassembly called "MySubAssembly", which contains a component called "MyComponent".&lt;/P&gt;&lt;P&gt;I want to get a reference to MyComponent WITHOUT iterating through all components in MySubAssembly and trying to match names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sure that there is a function along the lines of CreatePathToComponent("MySubAssembly", "MyComponent") (the syntax is obviously incorrect) and that I have even used it at some point, but I'm unable to find it in my code or anything about it online.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 09:41:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-component-in-subassembly-without-iteration/m-p/10129215#M121683</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-04T09:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get Component in subassembly without iteration</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-component-in-subassembly-without-iteration/m-p/10129293#M121685</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;I have not tested it yet!&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Public Sub Main
	
	Dim ass As Inventor.AssemblyDocument = ThisApplication.ActiveDocument
	Dim Occurrences As Inventor.ComponentOccurrences = ass.ComponentDefinition.Occurrences
	
'Dim occ As ComponentOccurrence
Dim assocc As Inventor.AssemblyDocument = ass.ComponentDefinition.Occurrences.ItemByName("MySubAssembly").Definition.Document
Dim PartOcc As Inventor.ComponentOccurrence = assocc.ComponentDefinition.Occurrences.ItemByName("MyComponent")

Dim p As Inventor.PartDocument =PartOcc.Definition.Document

End Sub&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 10:12:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-component-in-subassembly-without-iteration/m-p/10129293#M121685</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2021-03-04T10:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Get Component in subassembly without iteration</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-component-in-subassembly-without-iteration/m-p/10129644#M121692</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FYI&lt;/P&gt;&lt;P&gt;The function you were trying to remember is called "MakePath()".&lt;/P&gt;&lt;P&gt;There is a built-in iLogic Snippet for using it listed under the System tab / Components (classic).&lt;/P&gt;&lt;P&gt;Here is the online help reference page that talks about it:&amp;nbsp; (you'll need to scroll to the bottom of the web page)&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2021/ENU/?guid=GUID-B5D4DEE1-F637-44E0-8595-DB5E7E204E1C" target="_blank" rel="noopener"&gt;Component Functions Reference (iLogic)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 12:23:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-component-in-subassembly-without-iteration/m-p/10129644#M121692</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2021-03-04T12:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Get Component in subassembly without iteration</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-component-in-subassembly-without-iteration/m-p/10129681#M121693</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;Yes, this is it, thanks!&lt;/P&gt;&lt;P&gt;I started doubting if I really remembered it existing. &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@0E1C4C6A4039F60968930B2D80BE7018/emoticons/1f603.png" alt=":grinning_face_with_big_eyes:" title=":grinning_face_with_big_eyes:" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 12:35:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-component-in-subassembly-without-iteration/m-p/10129681#M121693</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-04T12:35:41Z</dc:date>
    </item>
  </channel>
</rss>

