Apply multiple text styles in one textnote programmatically

Apply multiple text styles in one textnote programmatically

jnoordzij
Advocate Advocate
215 Views
2 Replies
Message 1 of 3

Apply multiple text styles in one textnote programmatically

jnoordzij
Advocate
Advocate

I want to know if it is possible to change the text style for a subset of characters in a Revit textnote programmatically. Someone showed me below screenshot in which they were able to achieve this, I think using some special plugin. I want to know if it is possible to do this through the Revit API. If so, could you point me towards the API docs where this is described? 

 

Example : lets say I have textnote containing the text 'Text 1 / Text 2'. I want to be able to assign a different textstyle to the 'Text 2' substring. 

 

Your help is much appreciated

 

jnoordzij_0-1741680081660.png

 

0 Likes
216 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

I asked Gemini for you. Please check whether this helps:

  

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 3

jnoordzij
Advocate
Advocate

Hi Jeremy! Great to see you're still going strong.  

 

I'm not super enthusiastic about Gemini's suggestion to create separate Textboxes positioned side by side to create the appearance of a single, formatted Textbox. I want to avoid separate textboxes.  

 

However it did point me towards finding the TextNote.GetFormattedText / SetFormattedText methods. The FormattedText class seems to offer what I need !

 

Thanks for your help. Nice tool this Gemini 🙂  

0 Likes