Anyway to underline strings

Hello,

I was wondering if there is a way to underline strings in dynamo so when a text box places in a revit model the text is underlined? I know you can underline text within revit by highlighting the text but I wanted to see if there was a way I could do this in dynamo.

Thank you in advance

Thank you,

Are you familiar with how to implement the scripts from that thread? I went through and tried to but was unable to get any to work.

Any help is greatly appreciated.

Yes, but it has been awhile. What have you tried so far?

1 Like

I tried just copying them into dynamo since the thread was saying some worked but none of them would output what I was looking for. Im not too familiar with python either so i couldnt really trouble shoot the errors.

Show the errors so the community can try and understand what isn’t working. Otherwise we can only guess at what issue you may be having.

Hello,

I made a recent post about this but thought I would better explain my problem in a new one. I am trying to get the top line of text to show up underlined for a text note. Now I know there isnt a built in node for this and a python script is need for it. I have no experience with python so it would be really appreciated if someone could show me a python script that I could just add in as a node.

I have attached screen shots so far and add a picture of what the final product should look like. I can get everything except one of the lines to be underlined. Any help on this is greatly appreciated.

Thank you in advance
Screenshot (181)

Hello @Clayton.Woollen_UVKH one way could probably be split the multiline textnote to single text and use a texttype with underline and the lowest without…ps…please dont create duplicate post, better just give more information in the original post, then its easyer to get help and help…

2 Likes

Hello, no need to create multiple subjects (for searches then this will create problems) yesterday you asked Mr. Jacob, you did not show many tests.

Here is a deliberately ‘truncated’ solution (an element provided instead of a list but not insurmountable)
The spirit of the forum is to help but at a minimum you must show that you are making an effort and not waiting at all.


Thanks to Mr. Pierson Gartland and Crapai and Mr. Jacob’s referral link for the link on the API

import sys
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
element = UnwrapElement(IN[0])
indexend=IN[1]

TransactionManager.Instance.EnsureInTransaction(doc)
underline=element.GetFormattedText()
underline.SetUnderlineStatus(TextRange(0,indexend[0]), True)
element.SetFormattedText(underline)
TransactionManager.Instance.TransactionTaskDone()

OUT = element

Sincerely
christian.stan

3 Likes

No need to duplicate the topic - you can always add the context in the original topic as a reply. This also makes things more complicated for future users as subsequent searches might only find your otherwise abandoned thread.

Merging the two now so to prevent such issues in the future. :slight_smile:

4 Likes

Thank you for all the help, sorry for making two threads wasn’t my intention to cause any confusion.

I was able to get it to work for a list of elements as well.

Thanks again for the help

3 Likes