<?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 AllLeafOccurrences and View Representation in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/allleafoccurrences-and-view-representation/m-p/11544879#M30645</link>
    <description>&lt;P&gt;In Inv 2023 iLogic, I am using&amp;nbsp;&lt;SPAN&gt;AllLeafOccurrences to cycle thru a large assemblies to turn off the visibility of specific parts by iProp value.&amp;nbsp; This I then create a filtered Parts List by View&amp;nbsp;&lt;/SPAN&gt;Representation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The problem is with subassemblies that have a BOM Structure other than Phantom still show in the&amp;nbsp;filtered Parts List.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;AllLeafOccurrences only search thru parts (ipt).&amp;nbsp; Is there a better method that will search for Parts &amp;amp; Assemblies?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do I need to cycle thru twice once for parts and again for Assemblies by BOM Structure.&amp;nbsp; The file could have 10K occurrences!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Parts List Filtered.jpg" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1138495i18F9D411A3EC8B35/image-size/large?v=v2&amp;amp;px=999" role="button" title="Parts List Filtered.jpg" alt="Parts List Filtered.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Nov 2022 22:16:27 GMT</pubDate>
    <dc:creator>SteveK88</dc:creator>
    <dc:date>2022-11-10T22:16:27Z</dc:date>
    <item>
      <title>AllLeafOccurrences and View Representation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/allleafoccurrences-and-view-representation/m-p/11544879#M30645</link>
      <description>&lt;P&gt;In Inv 2023 iLogic, I am using&amp;nbsp;&lt;SPAN&gt;AllLeafOccurrences to cycle thru a large assemblies to turn off the visibility of specific parts by iProp value.&amp;nbsp; This I then create a filtered Parts List by View&amp;nbsp;&lt;/SPAN&gt;Representation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The problem is with subassemblies that have a BOM Structure other than Phantom still show in the&amp;nbsp;filtered Parts List.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;AllLeafOccurrences only search thru parts (ipt).&amp;nbsp; Is there a better method that will search for Parts &amp;amp; Assemblies?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do I need to cycle thru twice once for parts and again for Assemblies by BOM Structure.&amp;nbsp; The file could have 10K occurrences!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Parts List Filtered.jpg" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1138495i18F9D411A3EC8B35/image-size/large?v=v2&amp;amp;px=999" role="button" title="Parts List Filtered.jpg" alt="Parts List Filtered.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 22:16:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/allleafoccurrences-and-view-representation/m-p/11544879#M30645</guid>
      <dc:creator>SteveK88</dc:creator>
      <dc:date>2022-11-10T22:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: AllLeafOccurrences and View Representation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/allleafoccurrences-and-view-representation/m-p/11545145#M30646</link>
      <description>&lt;P&gt;You can use AllReferenceOccurrences and a recursion function. see syntax reference&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2021/ENU/?guid=GUID-0C5859C6-83AB-4F62-A92B-73B419DFE96C" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;ComponentOccurrences.AllReferencedOccurrences( Object As Object ) As ComponentOccurrencesEnumerator&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And also methods to work with assemblies and occurrences &lt;A href="https://modthemachine.typepad.com/my_weblog/2009/03/accessing-assembly-components.html" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&amp;nbsp; Can you post the relevant&amp;nbsp; code your using ?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 01:25:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/allleafoccurrences-and-view-representation/m-p/11545145#M30646</guid>
      <dc:creator>A.Acheson</dc:creator>
      <dc:date>2022-11-11T01:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: AllLeafOccurrences and View Representation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/allleafoccurrences-and-view-representation/m-p/11545995#M30647</link>
      <description>&lt;P&gt;Thanks for the info.&amp;nbsp; I will try this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is attached.&amp;nbsp; This version searched by Name as it is faster that iProp but I may need both.&lt;/P&gt;&lt;P&gt;It is setup with Case statements so users can 'hard code' the search variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 12:19:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/allleafoccurrences-and-view-representation/m-p/11545995#M30647</guid>
      <dc:creator>SteveK88</dc:creator>
      <dc:date>2022-11-11T12:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: AllLeafOccurrences and View Representation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/allleafoccurrences-and-view-representation/m-p/11546384#M30648</link>
      <description>&lt;P&gt;Using&amp;nbsp;AllReferencedDocuments recognizes the document (iam &amp;amp; ipt) not the occurrence.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can turn off visibility of occurrences but not of a document.&lt;/P&gt;&lt;P&gt;I would need to cycle thru all occurrences of the found document (iam &amp;amp; ipt) and turn off the visibility.&lt;/P&gt;&lt;P&gt;Kind of back to the original issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I missing something?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 15:41:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/allleafoccurrences-and-view-representation/m-p/11546384#M30648</guid>
      <dc:creator>SteveK88</dc:creator>
      <dc:date>2022-11-11T15:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: AllLeafOccurrences and View Representation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/allleafoccurrences-and-view-representation/m-p/11546980#M30649</link>
      <description>&lt;P&gt;I see the behavior now. The assemblies visibility was remaining on even thou the parts were switched off.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change this line&lt;/P&gt;&lt;PRE&gt; &lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oOccs&lt;/SPAN&gt;.&lt;SPAN&gt;AllLeafOccurrences&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;to&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oOccs&lt;/SPAN&gt;.&lt;SPAN&gt;AllReferencedOccurrences&lt;/SPAN&gt;(&lt;SPAN&gt;oDef&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 20:27:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/allleafoccurrences-and-view-representation/m-p/11546980#M30649</guid>
      <dc:creator>A.Acheson</dc:creator>
      <dc:date>2022-11-11T20:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: AllLeafOccurrences and View Representation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/allleafoccurrences-and-view-representation/m-p/11547057#M30650</link>
      <description>&lt;P&gt;Thank you. But that will now turn off visibility of the parent assembly that I do not want since all children are then non-visible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll need to add a line to identify the assembly BOM Structure.&amp;nbsp; If BOM Structure is Phantom, not to turn off visibility.&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;It might be better to run thru turnoff all assemblies then run again to turn ON the parts I want on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 21:07:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/allleafoccurrences-and-view-representation/m-p/11547057#M30650</guid>
      <dc:creator>SteveK88</dc:creator>
      <dc:date>2022-11-11T21:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: AllLeafOccurrences and View Representation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/allleafoccurrences-and-view-representation/m-p/11547179#M30651</link>
      <description>&lt;P&gt;It is working, I had to stitch this in,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN&gt;BOMStructure&lt;/SPAN&gt; &amp;lt;&amp;gt; 51971 &lt;SPAN&gt;Or&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN&gt;DefinitionDocumentType&lt;/SPAN&gt; = &lt;SPAN&gt;kPartDocumentObject&lt;/SPAN&gt;  &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;'Phantom BOM Structure AND not a Part&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 22:23:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/allleafoccurrences-and-view-representation/m-p/11547179#M30651</guid>
      <dc:creator>SteveK88</dc:creator>
      <dc:date>2022-11-11T22:23:48Z</dc:date>
    </item>
  </channel>
</rss>

