Hi @Darkforce_the_ilogic_guy. I have something that you may be able to use for your task. I customized it to report the findings similarly to how you have it formatted in your initial post. Since I do not know if you are working with a part or an assembly, I left it as it was, for working on a part. It will look at all of the HoleFeatures in the part, and if they are threaded, it will capture their thread designation, and the count of each one with the same thread designation. It then does the same with ThreadFeatures, but I customized it to only look at internal threaded ThreadFeatures. Let me know if this will work OK for your needs.
Sub Main
Dim oPDoc As PartDocument = ThisDoc.Document
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oHoleFeats As HoleFeatures = oPDef.Features.HoleFeatures
Dim oThreadFeats As ThreadFeatures = oPDef.Features.ThreadFeatures
Dim oDict As New Dictionary(Of String, Integer)
If oHoleFeats.Count = 0 Then GoTo CheckThreadFeats
For Each oHF As HoleFeature In oHoleFeats
If Not oHF.Tapped Then Continue For
Dim oHTI As HoleTapInfo = oHF.TapInfo
Dim sTD As String = oHTI.ThreadDesignation
If oDict.Keys.Contains(sTD) Then
oDict.Item(sTD) = oDict.Item(sTD) + 1
Else
oDict.Add(sTD, 1)
End If
Next
CheckThreadFeats :
If oThreadFeats.Count = 0 Then GoTo FinalReport
For Each oTF As ThreadFeature In oThreadFeats
If Not oTF.ThreadInfo.Internal Then Continue For
Dim sTD As String = oTF.ThreadInfo.ThreadDesignation
If oDict.Keys.Contains(sTD) Then
oDict.Item(sTD) = oDict.Item(sTD) + 1
Else
oDict.Add(sTD, 1)
End If
Next
FinalReport :
If oDict.Count = 0 Then
MsgBox("No Threaded Holes found.", , "")
Else
Dim oReport As String = ""
For Each oEntry In oDict
oReport = oReport & vbCrLf & oEntry.Value & " qty " & oEntry.Key
Next
MsgBox(oReport, vbInformation, "")
End If
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)