Dear Experts,
There is something wrong with Dynamo / Revit integration for (Multi row text) and wonder if have any solution.
When we use getparametervalue to get text value with single row, everything is OK.
However, when we use getparametervalue to get text value with multi row, the value is not correct. Please see attached file. What can be reason for that? Thanks.
Test.dyn (16.1 KB)
A new line in DesignScript, just like a new line in code, is not the same as a line break. You can even see in your code block how the 2 isn’t recognized as text. You need to use the line break character (\n
) to match the parameter value.
"1\n2"
Unfortunately not all line breaks are created equal. Not sure which special character Revit uses if it’s not the same \n
. You might be able to use some python magic to remove the break. Otherwise I’d suggest separating the strings with a blank (""
) as the separator and compare the individual characters. That seems to work with different line breaks.
It may also be a carriage return \r.
Two things to try:
-
Pull the length of the string with a string.length node. This will let us know if there is an extra line used internally for formatting or as a flag which isn’t displayed to the user.
-
Try using
”1\r2”
as @Robert_Younger pointed out.
None of method working. So strange
In the family double row value entered by coping from word or using alt enter. None of method working (Project file uploded for your review.).
Test.dyn (23.3 KB)
What is the result of string.length?
Hi @kvusal can you share a simple revit file?
Cheers
Please find:
Project File. https://we.tl/t-XNBHiE37jh
Screenshot:
Notice that there are four characters in the string. This means there is something we don’t see in the string itself.
Try using a String.Replace node to replace spaces with an underscore as a first step. In design script that would be something like String.Replace(str, ” “, “_”);
This appears to be the image from your prior post. What does the parameter’s string look like if you replace spaces with underscores?
Sorry. Corrected screenshot. Please check above post.
Another one-off workaround you can try is to isolate the special character (with something like String.Substring
) and copy it to your clipboard. I believe you can then paste it back into a string node and use that as your searchFor
input when replacing.
That’s the next step. My guess is it is the character at index 1 or index 2.
Dear Nick and Jacob, many THANKS for time and help. However, still no any result.
Dear Paris, thank you as well. Your suggesting worked normally, however i need to get text from revit not from dynamo. So when I am getting text from revit can not handle it as listed previous screenshots. Very upset about this dynamo bug.
@kvusal Looks like Revit adds “\r\n” as a line separator following the windows format.
Try this and it should work:
Dear Amol, Many thanks. I was about to give up about solution and considering Dynamo Bug. Many thanks again.