Strings with line breaks lose formatting on import to Revit

Hi All,

I’m working on a graph that imports text data into Revit families within a project. Everything is working as intended except for one part.

Strings that contain line breaks do not cleanly carry the formatting into Revit. The strings look fine in Dynamo (Image 01), but once imported to Revit the spacing/formatting is all messed up (Image 02). It’s a multi-line text parameter that is getting the text, but it all comes through in a single line (Image 03).

I tried routing it through Excel, and while it also didn’t keep the formatting at first, once I clicked on a cell containing the data it all jumped to the correct spots. Importing it from there worked as intended (Image 04), but having this extra manual step of nudging the formatting in Excel to fix it somewhat defeats the purpose.

Any ideas why this might be happening and/or any solutions/workarounds?

Thanks in advance.

-Had to merge all the images into one b/c this is my 1st post.

Hi Logan, welcome! :wave:
Which version of Revit / Dynamo are you using? - I’ve tried this in 2024 and can’t seem to replicate the issue.
What is the source of your text?
You could try using escape sequences (see here)
"This is a test\rof linebreaks\rthis is a carriage return\nthis is a newline"
image

1 Like

Thanks for the reply and that link!

I needed to include “\n”, previously just had “\r”.

I should have included this part of the graph as a screenshot originally, but here it is working correctly.

Thanks again

1 Like