<?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 Pick Function and Assembly Patterns in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/pick-function-and-assembly-patterns/m-p/10997718#M135346</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I'm running into a small problem with my ilogic rule where I have a variable to set to a component occurrence object using the kAssemblyOccurrenceFilter.&amp;nbsp; On individual occurrences it works fine but it seams to somehow switch to kAssemblyLeafOccurrenceFilter when trying to select a occurrence in an assembly pattern.&amp;nbsp; &amp;nbsp;Unless I select the occurrence in the model tree it seems to only let me select the individual parts in the sub-assembly.&lt;/P&gt;&lt;P&gt;My questions being&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Why does it do that?&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; How do I have it so it selects the assembly occurrence instead?&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2022 23:37:58 GMT</pubDate>
    <dc:creator>Noah.ClarkX5FEF</dc:creator>
    <dc:date>2022-03-10T23:37:58Z</dc:date>
    <item>
      <title>Pick Function and Assembly Patterns</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/pick-function-and-assembly-patterns/m-p/10997718#M135346</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I'm running into a small problem with my ilogic rule where I have a variable to set to a component occurrence object using the kAssemblyOccurrenceFilter.&amp;nbsp; On individual occurrences it works fine but it seams to somehow switch to kAssemblyLeafOccurrenceFilter when trying to select a occurrence in an assembly pattern.&amp;nbsp; &amp;nbsp;Unless I select the occurrence in the model tree it seems to only let me select the individual parts in the sub-assembly.&lt;/P&gt;&lt;P&gt;My questions being&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Why does it do that?&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; How do I have it so it selects the assembly occurrence instead?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 23:37:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/pick-function-and-assembly-patterns/m-p/10997718#M135346</guid>
      <dc:creator>Noah.ClarkX5FEF</dc:creator>
      <dc:date>2022-03-10T23:37:58Z</dc:date>
    </item>
    <item>
      <title>Betreff: Pick Function and Assembly Patterns</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/pick-function-and-assembly-patterns/m-p/11000459#M135373</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why? Don't know. I would also expect to get the assembly, not the containing part.&lt;/P&gt;&lt;P&gt;You can try to check if the picked object is a ComponentOccurrenceProxy. If so, get the ContainingOccurrence object and check again if this is a ComponentOccurrenceProxy. Do this stepping up until the ContainingOccurence is a ComponentOccurrence. If the ComponentOccurrence.IsPatternElement=True then you should have found the assembly in the pattern.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2022 10:14:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/pick-function-and-assembly-patterns/m-p/11000459#M135373</guid>
      <dc:creator>Ralf_Krieg</dc:creator>
      <dc:date>2022-03-12T10:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Pick Function and Assembly Patterns</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/pick-function-and-assembly-patterns/m-p/11003233#M135412</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12164016"&gt;@Noah.ClarkX5FEF&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I experienced the same thing when I was writing one of my VBA macros. Couldn't find anything about this specific behavior with patterned items.&lt;BR /&gt;I ended up creating a class that handles the selection process which actually uses the kAssemblyLeafOccurrenceFilter as filter setting and 'travels up' to find the highest sub-assembly level containing the selected component occurrence.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    'Check if the selected occurrence is in a sub assembly
    If oOcc.OccurrencePath.Count &amp;gt; 1 Then
        
        'Get the highest sub assembly containing it
        Do Until oOcc.OccurrencePath.Count = 1
            Set oOcc = oOcc.ContainingOccurrence
        Loop
    End If&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 10:47:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/pick-function-and-assembly-patterns/m-p/11003233#M135412</guid>
      <dc:creator>_dscholtes_</dc:creator>
      <dc:date>2022-03-14T10:47:05Z</dc:date>
    </item>
  </channel>
</rss>

