lisa-marie mueller

lisa-marie mueller

bullet pont

change text case link

September 11, 2020

colored pencils writing title on paper and clock - in blue Happy Friday! The next few weeks I'm going to do a short series related to text. I hadn't work with the text in the Revit API before so I just choose two simple tasks to try out a few things and better familiarize myself with it. TextCase allows you to select a TextNote and changes all the text in the TextNote to uppercase. Format Selector and Painter is a simple text format painting tool that saves any text overrides from a selected TextNote and applies them to another TextNote. The goal was to understand how to manipulate text formatting through the API and have these tools to build upon.

select text box

This week we will start with the TextCase plug-in. There are two parts to it - selecting the text box and changing the case to upper case. To select the text box, we can create a new method and call it SelectText. It will return the list of TextNotes. We use a selection filter to select the text boxes and then we need to take each Reference, cast it to a TextNote, and if the cast succeeds, add it to our list.

text to uppercase

Then once we have our text notes, we want to change the case of our text. We can start a new method and call it TextToUPPERCASE. It will not return anything. Our method needs the UIdoc and the text we selected as parameters. To access the formatting, we need to use the GetFormattedText method and we also need the plain text by using the GetPlainText method. We assign both to variables to make them easier to reference. In order to change text to upper case in Revit, you need to take the plain text and make all the characters uppercase. We can do this using the standard C# ToUpper method. Then we simply set the TextNote’s PlainText to the upperCase text we just made and then use the SetFormattedText method to assign the updated FormattedText.


With only a few simple steps, we can see how we can manipulate text properties in Revit. Next week, we will look at some of the other properties we can adjust and start making a simple format selecting and painting tool.


If you want to learn to code and don’t know where to start check out my posts about Steps to Learn to Code [for architects and designers] Part 1 and Part 2.

Revit API Docs

bullet pont

recommended next