This code will help you explore those prompted entries in your title block. Something similar would be used for checking their values, or setting new values to them, if changed a bit, and customized to your specific needs. It can be fairly complicated to automate those by code, unless extremely familiar with that specific drawing.
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
Dim oSheet As Sheet = oDDoc.ActiveSheet
If oSheet.TitleBlock Is Nothing Then
MsgBox("There is no TitleBlock on the active sheet. Exiting rule.", vbCritical,"")
Exit Sub 'or Continue For if in a Loop
End If
Dim oTB As TitleBlock = oSheet.TitleBlock
Dim oTBDef As TitleBlockDefinition = oTB.Definition
Dim oSketchCopy As DrawingSketch = Nothing
oTBDef.Edit(oSketchCopy)
Dim oTBoxs As Inventor.TextBoxes = oSketchCopy.TextBoxes
If oTBoxs.Count = 0 Then
MsgBox("There are no TextBoxes in the TitleBlock. Exiting rule.", vbCritical,"")
Exit Sub
End If
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, , "")
'the following would be used to enter a new value for the 'Prompted Entry'
'oTB.SetPromptResultText(oTBox, oNewResultStringValue)
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) 👍.
Wesley Crihfield

(Not an Autodesk Employee)