TextNoteSetFormattedText Method |
Sets the text and associated formatting of the text of in this text note with
a given FormattedText object.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic void SetFormattedText(
FormattedText formattedText
)
Public Sub SetFormattedText (
formattedText As FormattedText
)
public:
void SetFormattedText(
FormattedText^ formattedText
)
member SetFormattedText :
formattedText : FormattedText -> unit
Parameters
- formattedText FormattedText
-
The FormattedText object containing the text and associated formatting of the text.
Exceptions
Example#region Autodesk.Revit.DB.FormattedText
public void FormatText(TextNote textNote)
{
FormattedText formatText = textNote.GetFormattedText();
TextRange range = new TextRange(0, 3);
formatText.SetItalicStatus(range, true);
range = formatText.Find("sample", 0, false, true);
if (range.Length > 0)
formatText.SetBoldStatus(range, true);
range = formatText.Find("text", 0, false, true);
if (range.Length > 0)
formatText.SetUnderlineStatus(range, true);
formatText.SetAllCapsStatus(true);
textNote.SetFormattedText(formatText);
}
#endregion
#Region "Autodesk.Revit.DB.FormattedText"
Public Sub FormatText(textNote As TextNote)
Dim formatText__1 As FormattedText = textNote.GetFormattedText()
Dim range As New TextRange(0, 3)
formatText__1.SetItalicStatus(range, True)
range = formatText__1.Find("sample", 0, False, True)
If range.Length > 0 Then
formatText__1.SetBoldStatus(range, True)
End If
range = formatText__1.Find("text", 0, False, True)
If range.Length > 0 Then
formatText__1.SetUnderlineStatus(range, True)
End If
formatText__1.SetAllCapsStatus(True)
textNote.SetFormattedText(formatText__1)
End Sub
#End Region
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also