<?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: Ilogic to count parts in subassembly in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-count-parts-in-subassembly/m-p/9553972#M111570</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;Thank you for your reply. It worked well but I wonder if it possible to even find virtual components in subassemblies? In some subbassemblies have we added a couple of virtual components,&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jun 2020 05:09:00 GMT</pubDate>
    <dc:creator>goran.nilssonRSJCU</dc:creator>
    <dc:date>2020-06-02T05:09:00Z</dc:date>
    <item>
      <title>Ilogic to count parts in subassembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-count-parts-in-subassembly/m-p/9552445#M111551</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a top-assembly that consists of a large number of sub-assemblies.&lt;/SPAN&gt; &lt;SPAN&gt;I want to go through all the sub-assemblies and look for a specific part number ( like iProperties PartNumber ="73265" ) and then return in which sub-assemblies that the specified part number is included in. How can I get in which sub-assembly that the specified part number is included?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2020 12:07:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-count-parts-in-subassembly/m-p/9552445#M111551</guid>
      <dc:creator>goran.nilssonRSJCU</dc:creator>
      <dc:date>2020-06-01T12:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic to count parts in subassembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-count-parts-in-subassembly/m-p/9552482#M111552</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7311113"&gt;@goran.nilssonRSJCU&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the partnumber you're looking for is always a part you could try this rule &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oPnr&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Part number: "&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Enter part number"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"PARTNUMBER"&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Msg&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"Part exists in: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;vbCrLf&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;New&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;List&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;partExists&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Boolean&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;ComponentOccurrence&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Occurrences&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllLeafOccurrences&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Definition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Design Tracking Properties"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Part Number"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oPnr&lt;/SPAN&gt;
		&lt;SPAN style="color: #800000;"&gt;partExists&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Contains&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ParentOccurrence&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;) = &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ParentOccurrence&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;)

		&lt;SPAN style="color: #ff0000;"&gt;Catch&lt;/SPAN&gt;
			&lt;SPAN style="color: #808080;"&gt;'Part is in top level assembly&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Contains&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DisplayName&lt;/SPAN&gt;) = &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DisplayName&lt;/SPAN&gt;)
		&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;partExists&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oItem&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;Msg&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Msg&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oItem&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;vbCrLf&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Msg&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Sub-assemblys containing part"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;MessageBoxButtons&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;OK&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Cant find part with partnumber: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oPnr&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Sub-assemblys containing part"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;MessageBoxButtons&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;OK&lt;/SPAN&gt;)	
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Jun 2020 12:26:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-count-parts-in-subassembly/m-p/9552482#M111552</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-06-01T12:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic to count parts in subassembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-count-parts-in-subassembly/m-p/9552778#M111556</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7311113"&gt;@goran.nilssonRSJCU&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is probably better. This code searches for both parts and assemblies with the specified part number.&lt;/P&gt;&lt;P&gt;Then it returns a list of all the subassemblies (or top assembly) that contains the an occurrence with that part number.&lt;/P&gt;&lt;P&gt;It also counts how many of it exists in each subassembly &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Pnr&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Enter partnumber: "&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Search for partnumber"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"000000"&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;New&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Dictionary&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;Integer&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Msg&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"Component count in Assembly/Subassemblies: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;vbCrLf&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;pNrExists&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Boolean&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllReferencedDocuments&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Or&lt;/SPAN&gt; _
		&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kAssemblyDocumentObject&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Design Tracking Properties"&lt;/SPAN&gt;) _
			.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Part Number"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Pnr&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;ComponentOccurrence&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Occurrences&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllReferencedOccurrences&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;)
				&lt;SPAN style="color: #800000;"&gt;pNrExists&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;
					&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ContainsKey&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ParentOccurrence&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;)
						&lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ParentOccurrence&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;) += 1
					&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
						&lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ParentOccurrence&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;, 1)
					&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;Catch&lt;/SPAN&gt;
					&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ContainsKey&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Top level assembly"&lt;/SPAN&gt;)
						&lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Top level assembly"&lt;/SPAN&gt;) += 1
					&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
						&lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Top level assembly"&lt;/SPAN&gt;, 1)
					&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oKey&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Keys&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;Msg&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Msg&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oKey&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;" - "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oKey&lt;/SPAN&gt;) &amp;amp; &lt;SPAN style="color: #008080;"&gt;" st"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;vbCrLf&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;pNrExists&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Msg&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Found components"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;MessageBoxButtons&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;OK&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"None!"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Found components"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;MessageBoxButtons&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;OK&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
			&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Jun 2020 14:26:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-count-parts-in-subassembly/m-p/9552778#M111556</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-06-01T14:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic to count parts in subassembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-count-parts-in-subassembly/m-p/9553972#M111570</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;Thank you for your reply. It worked well but I wonder if it possible to even find virtual components in subassemblies? In some subbassemblies have we added a couple of virtual components,&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 05:09:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-count-parts-in-subassembly/m-p/9553972#M111570</guid>
      <dc:creator>goran.nilssonRSJCU</dc:creator>
      <dc:date>2020-06-02T05:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic to count parts in subassembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-count-parts-in-subassembly/m-p/9554025#M111571</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7311113"&gt;@goran.nilssonRSJCU&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should cover virtual components aswell &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Pnr&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Enter partnumber: "&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Search for partnumber"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"000000"&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;New&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Dictionary&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;Integer&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Msg&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"Component count in Assembly/Subassemblies: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;vbCrLf&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;pNrExists&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Boolean&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;ComponentOccurrence&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Occurrences&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;TypeOf&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Definition&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;VirtualComponentDefinition&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Definition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PropertySets&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Design Tracking Properties"&lt;/SPAN&gt;) _
			(&lt;SPAN style="color: #008080;"&gt;"Part Number"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Pnr&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ContainsKey&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Top level assembly"&lt;/SPAN&gt;)
				&lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Top level assembly"&lt;/SPAN&gt;) += 1
			&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
				&lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Top level assembly"&lt;/SPAN&gt;, 1)
			&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;pNrExists&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllReferencedDocuments&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Or&lt;/SPAN&gt; _
		&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kAssemblyDocumentObject&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kAssemblyDocumentObject&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;ComponentOccurrence&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Occurrences&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;TypeOf&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Definition&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;VirtualComponentDefinition&lt;/SPAN&gt;
					&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Definition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PropertySets&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Design Tracking Properties"&lt;/SPAN&gt;) _
						(&lt;SPAN style="color: #008080;"&gt;"Part Number"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Pnr&lt;/SPAN&gt;
						&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;parentOcc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;ComponentOccurrence&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;. _
							&lt;SPAN style="color: #800000;"&gt;Occurrences&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllReferencedOccurrences&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;)
							&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ContainsKey&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;parentOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;)
								&lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;parentOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;) += 1
							&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
								&lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;parentOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;, 1)
							&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
							&lt;SPAN style="color: #800000;"&gt;pNrExists&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;
						&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
					&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Design Tracking Properties"&lt;/SPAN&gt;) _
			.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Part Number"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Pnr&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;ComponentOccurrence&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oAsm&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Occurrences&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllReferencedOccurrences&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;)
				&lt;SPAN style="color: #800000;"&gt;pNrExists&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;
					&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ContainsKey&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ParentOccurrence&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;)
						&lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ParentOccurrence&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;) += 1
					&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
						&lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ParentOccurrence&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;, 1)
					&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;Catch&lt;/SPAN&gt;
					&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ContainsKey&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Top level assembly"&lt;/SPAN&gt;)
						&lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Top level assembly"&lt;/SPAN&gt;) += 1
					&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
						&lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Top level assembly"&lt;/SPAN&gt;, 1)
					&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oKey&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Keys&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;Msg&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Msg&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oKey&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;" - "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oList&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oKey&lt;/SPAN&gt;) &amp;amp; &lt;SPAN style="color: #008080;"&gt;" st"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;vbCrLf&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;pNrExists&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Msg&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Found components"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;MessageBoxButtons&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;OK&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
	&lt;SPAN style="color: #800000;"&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Show&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"None!"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Found components"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;MessageBoxButtons&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;OK&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Jun 2020 06:08:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-count-parts-in-subassembly/m-p/9554025#M111571</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-06-02T06:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic to count parts in subassembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-count-parts-in-subassembly/m-p/12471642#M162009</link>
      <description>&lt;P&gt;What is the diferrence with the bill material?&amp;nbsp;&amp;nbsp;In it you already see all the data such as the piece (part number) quantity&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2024 07:47:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-count-parts-in-subassembly/m-p/12471642#M162009</guid>
      <dc:creator>Moverano</dc:creator>
      <dc:date>2024-01-02T07:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic to count parts in subassembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-count-parts-in-subassembly/m-p/13070209#M172609</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Love your code. Fast and easy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I noticed sometimes the qty per assembly is not always correct, it seems to occur with phantom parts (?)&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 22:05:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-count-parts-in-subassembly/m-p/13070209#M172609</guid>
      <dc:creator>Vickimcl</dc:creator>
      <dc:date>2024-10-07T22:05:10Z</dc:date>
    </item>
  </channel>
</rss>

