<?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: more sort help. in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9126983#M102756</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this code (VBA).&lt;/P&gt;&lt;P&gt;The code counts the Parts which part number is started with "12345".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Option Explicit

'
' This Code is written in VBA.
'
Sub Main()
    Dim topAssyDoc As AssemblyDocument
    Set topAssyDoc = ThisApplication.ActiveEditDocument
    Dim count As Integer
    count = CountNewParts(topAssyDoc.ComponentDefinition.Occurrences)
    MsgBox "Count : " &amp;amp; count
End Sub

Function CountNewParts(occs As ComponentOccurrences) As Integer
    CountNewParts = 0
    Dim occ As ComponentOccurrence
    For Each occ In occs
        If IsNewPart(occ) Then
            CountNewParts = CountNewParts + 1
        ElseIf TypeOf occ.Definition Is AssemblyComponentDefinition Then
            CountNewParts = CountNewParts + CountNewParts(occ.Definition.Occurrences)
        End If
    Next occ
End Function

Function IsNewPart(occ As ComponentOccurrence) As Boolean
    IsNewPart = False
    If Not TypeOf occ.Definition Is PartComponentDefinition Then
        Exit Function
    End If
    Dim oPartDoc As PartDocument
    Set oPartDoc = occ.Definition.Document
    Dim partNumber As String
    partNumber = oPartDoc.PropertySets("{32853F0F-3444-11D1-9E93-0060B03C1CA6}")("Part Number").Value
    If Left(partNumber, 5) = "12345" Then
        IsNewPart = True
    End If
End Function&lt;/PRE&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.freeradical.jp" target="_blank" rel="noopener"&gt;Freeradical&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Nov 2019 02:20:34 GMT</pubDate>
    <dc:creator>HideoYamada</dc:creator>
    <dc:date>2019-11-05T02:20:34Z</dc:date>
    <item>
      <title>more sort help.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9118061#M102611</link>
      <description>&lt;P&gt;top level assm. would be 12345000&lt;/P&gt;&lt;P&gt;new parts would be 12345001 to 12345009&lt;/P&gt;&lt;P&gt;new sub assm. would be 12345010&amp;nbsp;&lt;/P&gt;&lt;P&gt;reused parts would be 11111001 to 11111009&lt;/P&gt;&lt;P&gt;reused assm. would be 11111010&lt;/P&gt;&lt;P&gt;i need to get a total number of new parts with total weight from the model.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 18:59:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9118061#M102611</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-30T18:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: more sort help.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9122205#M102693</link>
      <description>&lt;P&gt;still having some trouble with this one. any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 14:51:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9122205#M102693</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-01T14:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: more sort help.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9126013#M102744</link>
      <description>&lt;P&gt;no longer need weight just a count of new parts. here's what i have so far. it seems to miss all the part numbers&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;Main&lt;/SPAN&gt;() 
    &lt;SPAN&gt;' Get the active assembly. &lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt; 
    &lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
	
	&lt;SPAN&gt;' Get the assembly component definition. &lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAsmDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyComponentDefinition&lt;/SPAN&gt; 
    &lt;SPAN&gt;oAsmDef&lt;/SPAN&gt; = &lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Project"&lt;/SPAN&gt;, &lt;SPAN&gt;"Part Number"&lt;/SPAN&gt;)
	
	&lt;SPAN&gt;oNum&lt;/SPAN&gt; = &lt;SPAN&gt;oAsmDef&lt;/SPAN&gt;.&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Project"&lt;/SPAN&gt;, &lt;SPAN&gt;"Part Number"&lt;/SPAN&gt;,&lt;SPAN&gt;Left&lt;/SPAN&gt;(12345000,5))

    &lt;SPAN&gt;' Get all of the leaf occurrences of the assembly. &lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oLeafOccs&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrencesEnumerator&lt;/SPAN&gt; 
    &lt;SPAN&gt;oLeafOccs&lt;/SPAN&gt; = &lt;SPAN&gt;oAsmDef&lt;/SPAN&gt;.&lt;SPAN&gt;Occurrences&lt;/SPAN&gt;.&lt;SPAN&gt;AllLeafOccurrences&lt;/SPAN&gt; 

    &lt;SPAN&gt;' Iterate through the occurrences and print the name. &lt;/SPAN&gt;
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;cnt&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Integer&lt;/SPAN&gt; 
	&lt;SPAN&gt;cnt&lt;/SPAN&gt; = 0
	
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt; 
	&lt;SPAN&gt;oOcc&lt;/SPAN&gt; = &lt;SPAN&gt;oLeafOccs&lt;/SPAN&gt;(&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Project"&lt;/SPAN&gt;, &lt;SPAN&gt;"Part Number"&lt;/SPAN&gt;,&lt;SPAN&gt;Left&lt;/SPAN&gt;(12345000,5)))
    &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;oLeafOccs&lt;/SPAN&gt; 
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oLeafOccs&lt;/SPAN&gt; = &lt;SPAN&gt;oNum&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
		
			&lt;SPAN&gt;cnt&lt;/SPAN&gt; = &lt;SPAN&gt;cnt&lt;/SPAN&gt; + 1
			&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;) 
		&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
			 
    &lt;SPAN&gt;Next&lt;/SPAN&gt; 
	&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;cnt&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 16:35:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9126013#M102744</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-04T16:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: more sort help.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9126983#M102756</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this code (VBA).&lt;/P&gt;&lt;P&gt;The code counts the Parts which part number is started with "12345".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Option Explicit

'
' This Code is written in VBA.
'
Sub Main()
    Dim topAssyDoc As AssemblyDocument
    Set topAssyDoc = ThisApplication.ActiveEditDocument
    Dim count As Integer
    count = CountNewParts(topAssyDoc.ComponentDefinition.Occurrences)
    MsgBox "Count : " &amp;amp; count
End Sub

Function CountNewParts(occs As ComponentOccurrences) As Integer
    CountNewParts = 0
    Dim occ As ComponentOccurrence
    For Each occ In occs
        If IsNewPart(occ) Then
            CountNewParts = CountNewParts + 1
        ElseIf TypeOf occ.Definition Is AssemblyComponentDefinition Then
            CountNewParts = CountNewParts + CountNewParts(occ.Definition.Occurrences)
        End If
    Next occ
End Function

Function IsNewPart(occ As ComponentOccurrence) As Boolean
    IsNewPart = False
    If Not TypeOf occ.Definition Is PartComponentDefinition Then
        Exit Function
    End If
    Dim oPartDoc As PartDocument
    Set oPartDoc = occ.Definition.Document
    Dim partNumber As String
    partNumber = oPartDoc.PropertySets("{32853F0F-3444-11D1-9E93-0060B03C1CA6}")("Part Number").Value
    If Left(partNumber, 5) = "12345" Then
        IsNewPart = True
    End If
End Function&lt;/PRE&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.freeradical.jp" target="_blank" rel="noopener"&gt;Freeradical&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 02:20:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9126983#M102756</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-11-05T02:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: more sort help.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9128013#M102787</link>
      <description>&lt;P&gt;that does count everything. is there a way to automatically extract the first 5 digits of the top level assembly for the search string? also i only need to count .ipt files that start with the first 5 digits of the top level assembly. this counts subassemblies as parts too. thanks for helping me with this.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 13:05:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9128013#M102787</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-05T13:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: more sort help.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9128140#M102790</link>
      <description>&lt;P&gt;also i only need number of new part numbers created not number of new part occurrences. thanks for your help&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 13:45:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9128140#M102790</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-05T13:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: more sort help.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9128157#M102791</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;that does count everything. is there a way to automatically extract the first 5 digits of the top level assembly for the search string? also i only need to count .ipt files that start with the first 5 digits of the top level assembly. this counts subassemblies as parts too. thanks for helping me with this.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Delete or comment out these two lines :&lt;/P&gt;&lt;PRE&gt;'        ElseIf TypeOf occ.Definition Is AssemblyComponentDefinition Then
'            CountNewParts = CountNewParts + CountNewParts(occ.Definition.Occurrences)&lt;/PRE&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.freeradical.jp" target="_blank" rel="noopener"&gt;Freeradical&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 13:53:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9128157#M102791</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-11-05T13:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: more sort help.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9128177#M102792</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;also i only need number of new part numbers created not number of new part occurrences. thanks for your help&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Ah, this needs a bit complex code. Just wait...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 14:01:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9128177#M102792</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-11-05T14:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: more sort help.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9129559#M102809</link>
      <description>&lt;P&gt;Hello Keith,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I translated the VBA code into iLogic because I want to use .Net Collection Library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Option Explicit On
Sub Main()
    Dim topAssyDoc As AssemblyDocument = ThisApplication.ActiveEditDocument
    Dim newPartDocuments As New System.Collections.Generic.List(Of PartDocument)
    CountNewParts(topAssyDoc.ComponentDefinition.Occurrences, newPartDocuments)
    MessageBox.Show("Count : " + newPartDocuments.Count.ToString())
    newPartDocuments.Clear()
End Sub

Sub CountNewParts(occs As ComponentOccurrences, newPartDocuments As System.Collections.Generic.List(Of PartDocument)) 
    Dim occ As ComponentOccurrence
    For Each occ In occs
        If IsNewPart(occ) Then
            Dim oPartDoc As PartDocument = occ.Definition.Document
            If Not newPartDocuments.Contains(oPartDoc) Then
                newPartDocuments.Add(oPartDoc)
            End If
'        ElseIf TypeOf occ.Definition Is AssemblyComponentDefinition Then
'            CountNewParts(occ.Definition.Occurrences, newPartDocuments)
        End If
    Next occ
End Sub

Function IsNewPart(occ As ComponentOccurrence) As Boolean
    IsNewPart = False
    If Not TypeOf occ.Definition Is PartComponentDefinition Then
        Exit Function
    End If
    Dim oPartDoc As PartDocument = occ.Definition.Document
    Dim partNumber As String
    partNumber = oPartDoc.PropertySets("{32853F0F-3444-11D1-9E93-0060B03C1CA6}")("Part Number").Value
    If Left(partNumber, 5) = "12345" Then
        IsNewPart = True
    End If
End Function&lt;/PRE&gt;&lt;P&gt;This code reports the number of new part documents (not occurrences of new part documents).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.freeradical.jp" target="_blank" rel="noopener"&gt;Freeradical&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 00:56:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9129559#M102809</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-11-06T00:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: more sort help.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9135645#M102933</link>
      <description>&lt;P&gt;i made a little mod but your code works great. thanks for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub Main()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim topAssyDoc As AssemblyDocument = ThisApplication.ActiveEditDocument&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim newPartDocuments As New System.Collections.Generic.List(Of PartDocument)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim sSN As String&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sSN = InputBox("Please enter first five digits of parts you are interested in:", "Input needed", "xxxxx")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CountNewParts(topAssyDoc.ComponentDefinition.Occurrences, newPartDocuments, sSN)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;MessageBox.Show("Count : " + newPartDocuments.Count.ToString())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newPartDocuments.Clear()&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub CountNewParts(occs As ComponentOccurrences, newPartDocuments As System.Collections.Generic.List(Of PartDocument), sSN As String)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dim occ As ComponentOccurrence&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each occ In occs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If IsNewPart(occ, sSN) Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oPartDoc As PartDocument = occ.Definition.Document&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not newPartDocuments.Contains(oPartDoc) Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newPartDocuments.Add(oPartDoc)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;End If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ElseIf TypeOf occ.Definition Is AssemblyComponentDefinition Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CountNewParts(occ.Definition.Occurrences, newPartDocuments,sSN)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next occ&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 14:34:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/more-sort-help/m-p/9135645#M102933</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-08T14:34:51Z</dc:date>
    </item>
  </channel>
</rss>

