Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. public static global::Revit.Elements.Element ToUpper(global::Revit.Elements.Element textNote)
  2. {
  3. Autodesk.Revit.DB.Document doc = DocumentManager.Instance.CurrentDBDocument;
  4. Autodesk.Revit.DB.TextNote internalNote = (Autodesk.Revit.DB.TextNote)textNote.InternalElement;
  5.  
  6. //Get the text from the text box
  7. //we obtain formatted text and modify the caps instead of the string. Preserves formatting.
  8. FormattedText formattedText = internalNote.GetFormattedText();
  9. formattedText.SetAllCapsStatus(true);
  10. //Change all the text to upper case and reassign to the text box
  11. //using formatted text allows for the formatting to stay - John
  12. TransactionManager.Instance.EnsureInTransaction(doc);
  13. internalNote.SetFormattedText(formattedText);
  14. TransactionManager.Instance.TransactionTaskDone();
  15.  
  16. return textNote;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement