Hi @tonythm. Here is another example iLogic rule you can try for this task. Not really sure what type of output / results you are looking for, so I am must using MsgBox messages to show results. We could also write the results to the iLogic Log window, if you wanted.
Sub Main
Dim oDDoc As DrawingDocument = TryCast(ThisDoc.Document, Inventor.DrawingDocument)
If oDDoc Is Nothing Then Return
Dim oSSDefs As SketchedSymbolDefinitions = oDDoc.SketchedSymbolDefinitions
If oSSDefs.Count = 0 Then Return
Dim oSSDef As SketchedSymbolDefinition
Try : oSSDef = oSSDefs.Item("REVMARK") : Catch : End Try
If oSSDef Is Nothing Then
MsgBox("SketchedSymbolDefinition Named 'REVMARK' Not Found!", vbCritical, "iLogic")
Return
End If
'assuming that it only has 1 TextBox, and that one is for a 'Prompted Entry'
Dim oTB1 As Inventor.TextBox = oSSDef.Sketch.TextBoxes.Item(1)
Dim oSheets As Inventor.Sheets = oDDoc.Sheets
Dim oDict As New Dictionary(Of String, Integer)
For Each oSheet As Inventor.Sheet In oSheets
Dim oSSs As SketchedSymbols = oSheet.SketchedSymbols
If oSSs.Count = 0 Then Continue For
For Each oSS As SketchedSymbol In oSSs
If oSS.Definition Is oSSDef Then
Dim sResult As String = oSS.GetResultText(oTB1)
If oDict.ContainsKey(sResult) Then
oDict.Item(sResult) = oDict.Item(sResult) + 1
Else
oDict.Add(sResult, 1)
End If
End If
Next 'oSS
Next 'oSheet
If oDict.Count = 0 Then
MsgBox("No Rev SketchedSymbols Found In Drawing.", vbInformation, "iLogic")
Else
For Each oEntry In oDict
MsgBox("There were " & oEntry.Value.ToString & " instances for Rev " & oEntry.Key)
Next 'oEntry
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)