Here is a bit of example iLogic code you can use to investigate and play to help you further develop a solution that works the way you want it to. This was part of a larger project I had to assign attributes to the TextBoxes, once I had positively identified them, to make further processing by other tools later on a bit easier. It probably wouldn't take too much effort to create a custom Function for extracting the needed data, once you have adapted it to your scenario.
Sub Main
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
MsgBox("A Drawing Document must be active for this code to work. Exiting.", vbCritical, "")
Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisDoc.Document
oASheet = oDDoc.ActiveSheet
Dim oTB As TitleBlock = Nothing
Dim oTBDef As TitleBlockDefinition = Nothing
If oASheet.TitleBlock Is Nothing Then
Exit Sub 'or Continue For if in a Loop
Else
oTB = oASheet.TitleBlock
oTBDef = oTB.Definition
End If
Dim oSketchCopy As DrawingSketch = Nothing
oTBDef.Edit(oSketchCopy)
oTBoxs = oSketchCopy.TextBoxes
If oTBoxs.Count = 0 Then Exit Sub
For Each oTBox As Inventor.TextBox In oTBoxs
Dim oResultText As String = ""
Try
oResultText = oTB.GetResultText(oTBox)
Catch
MsgBox("GetResultText method failed.",,"")
End Try
MsgBox("Current TextBox Contents:" & vbCrLf & _
"TextBox.Text = " & oTBox.Text & vbCrLf & _
"TextBox.FormattedText = " & oTBox.FormattedText & vbCrLf & _
"oResultText = " & oResultText,,"")
Next
oTBDef.ExitEdit(False) 'False = don't save changes
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) 👍.
If you want and have time, I would appreciate your Vote(s) for My IDEAS :bulb: or you can Explore My CONTRIBUTIONS
Wesley Crihfield

(Not an Autodesk Employee)