Last active
September 5, 2019 13:10
-
-
Save johnpierson/11a6d0005bb1825254f771599eafbb37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static global::Revit.Elements.Element ToUpper(global::Revit.Elements.Element textNote) | |
{ | |
Autodesk.Revit.DB.Document doc = DocumentManager.Instance.CurrentDBDocument; | |
Autodesk.Revit.DB.TextNote internalNote = (Autodesk.Revit.DB.TextNote)textNote.InternalElement; | |
//Get the text from the text box | |
//we obtain formatted text and modify the caps instead of the string. Preserves formatting. | |
FormattedText formattedText = internalNote.GetFormattedText(); | |
formattedText.SetAllCapsStatus(true); | |
//Change all the text to upper case and reassign to the text box | |
//using formatted text allows for the formatting to stay - John | |
TransactionManager.Instance.EnsureInTransaction(doc); | |
internalNote.SetFormattedText(formattedText); | |
TransactionManager.Instance.TransactionTaskDone(); | |
return textNote; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment