I’m very new to Dynamo and i don’t have any experience in coding, I hope my question is simple!! Thanks for taking the time.
Under properties in Revit I have something called Data (Vico 01) it’s part of the Project Parameters
so what I’m trying to do each time I write the number (30.04) under Data (Vico 01), i want to run Dynamo and automatically change it from (30.04) to (30.04 - Grade Beam), as you can see here i tried do this
It may be best to use an if statement like x == "30.04" ? "30.04 Grade Beam" : x; instead of a String.Replace function, as sequential runs will iterate the result, potentially resulting in something like this:
Run 0 = 30.04
Run 1 = 30.04 Grade Beam
Run 2 = 30.04 Grade Beam Grade Beam
Run 3 = 30.04 Grade Beam Grade Beam Grade Beam…
Note that there are some speed implications to this, so be wary before proceeding with this route. String replace being a single function is almost always going to be faster than an equality test followed by the replacement (even if run in line). However, in my testing (using the text from 5 of Shakespeare’s plays) with Dynamo Sandbox 2.0.2 I didn’t see any significant difference (1/2 a second) until around 40,000 words (multiple plays).
You’re going to want to do some research on Dynamo Dictionaries
A Dynamo Dictionary is basically a table where you can have your number(30.04) in one column and your matching text (Grade Beam) in the second column.
Then you call the dictionary with the code and it returns the text.
Here’s screen shot of one that I made and how it’s used
Thank you for the reply, I’m very very new to Dynamo and honestly did not understand ( x == "30.04" ? "30.04 Grade Beam" : x; instead of a String.Replace function), if you could please show me an example ?!
as you can see I’ve made two different modules with the same input.
I like JacobSmall smart solution, but it seems it doesn’t work as it should.
What am I doing wrong?
And yes I would like to replace text “Family Type: Standard, Family: Coude - Générique” with text " Coude".
PS