Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement