Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: claudio.ibarra

Hi @claudio.ibarra.  Yes, this does sound possible.  In fact, I believe I have seen some other posts here on this forum about essentially the same task, but the view label may have been formatted a bit differently.  You could start from the Sheet.Balloons collection, because balloons belong to the sheet, not necessarily a DrawingView.  Then, once you have a Balloon, it has a property called ParentView you can use to get a reference to the DrawingView it is associated with.  Then you access the DrawingView.Label property to get the DrawingViewLabel object.  But the 'fun' part will be adding that text to its FormattedText String.  I don't have time today to go into that task, but I can show you a couple simple little tools to help you see what an existing DrawingViewLabel.FormattedText contains.

If you prepare the view's label the way you want it manually first, then run this rule, and select that view, it will show you the contents in a way that allows you to copy/edit the contents.  Mainly for educational purposes.

Dim oObj = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select a Drawing View.")
If oObj Is Nothing OrElse (TypeOf oObj Is DrawingView = False) Then Exit Sub
Dim oView As DrawingView = oObj
Dim sFText As String = oView.Label.FormattedText
Dim sEditedResult As String = InputBox("", "DrawingView.Label.FormattedText", sFText)
'use the next line to set the edited String back as the value for it to use
'oView.Label.FormattedText = sEditedResult

There is also a topic within the API help which talks about how to deal with FormattedText, because it contains XML tags, and can be a bit complicated to deal with at first.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)