Multiple line find and replace

Hi,
I am quite new to Dynamo and to this forum, so thank you in advance for reading this post.

We have a few Revit projects where we need to place all our text notes in two different languages. I’d like to be able to use the normal revit text rather than create a family as the normal text has better formatting options. I’ve created notes in English and then added the line ‘Translation text’ in the note too. I can then export all the notes in the project to an excel file where somebody who is fluent in the second language can translate them.
What I am having trouble with, is how I import that excel file back into revit and replace all the notes with the updated excel file which contains the notes in both languages. Do you think this is even possible ensuring the right notes get overwritten with the right text from the excel file?

Hi Nick,
First I want so say that the formating of text notes in Revit is still not great so you might not get an ideal result.
As for what you want:
If I understood your post correctly you have the notes placed in one language currently?
If that’s the case, I’d have the Excel file with the notes in two columns - the original and the translation.
I would use the original to find and match the existing text notes.
Then I would use the combined original + translation to set that to the textnotes.

1 Like

Best bet would likely to be using 3 columns. One for the element’s unique ID (GUID), one for the english value, and one for the second language.

Output should be easy enough, and for input you can just use a select by ID method followed by an Element.SetParameterValueByName node.

2 Likes

Hi @jacob.small, many thanks for your response.
I’ve included the ID in my export, as per your suggestion. When I do the import, do I need to use the Sring.Replace node rather than the Element.SetParameterValueByName node as I am dealing with Text Notes rather than families?
I have attempted this, but unsuccessfully! I get a warning on the string replace node saying that it is being asked to convert non-convertible types, which I assume is the ID’s. I think that the result of the string.replace node is still giving me what I want though (going by what I see in the Watch node), but it doesn’t update my notes in Revit.
Can you see where I might be going wrong?
Many thanks again.

You should be able to gather the elements by the id (meaning Select.ById or IDs To Elements which I believe is available in the ArchiLab package , not an All Elements Of Category node) followed by a SetText node

1 Like

Hi Jacob, I’ve got this to work now using the method you described. My first successful Dynamo script! Many thanks for your help. Screen shot below for anyone else interested.

1 Like