Hi, I think this code could work, it is to overwrite the value of the balloon without changing the value of the balloon item
Dim oDoc As DrawingDocument = ThisDoc.Document
Dim TXT2Find, NewTXT As String
TXT2Find = InputBox("Enter Text To Find:", "iLogic", "XXX")
If TXT2Find ="" Then Exit Sub
NewTXT = InputBox("Enter Text To Replace '"& TXT2Find & "' with.", "iLogic", "****")
For Each oSheet As Sheet In oDoc.Sheets
For Each oBalloon As Inventor.Balloon In oSheet.Balloons
oBalloon.BalloonValueSets.Item(1).OverrideValue = _
oBalloon.BalloonValueSets.Item(1).OverrideValue.Replace(TXT2Find, NewTXT)
Next
Next
Next to change the balloon item
Dim oDoc As DrawingDocument = ThisDoc.Document
Dim TXT2Find, NewTXT As String
TXT2Find = InputBox("Enter Text To Find:", "iLogic", "XXX")
If TXT2Find ="" Then Exit Sub
NewTXT = InputBox("Enter Text To Replace '"& TXT2Find & "' with.", "iLogic", "****")
For Each oSheet As Sheet In oDoc.Sheets
For Each oBalloon As Inventor.Balloon In oSheet.Balloons
oBalloon.BalloonValueSets.Item(1).Value = _
oBalloon.BalloonValueSets.Item(1).Value.Replace(TXT2Find, NewTXT)
Next
Next
I hope this helps with your problem. Cheers!!
Please accept as solution and give likes if applicable.
I am attaching my Upwork profile for specific queries.
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn