I exported my schedule to be able to modify from excel and read back to Revit.
But I am not sure which node I have to use there to read yes/no value.
Any suggestions? Thank you
Replace yes with 1 and no with 0 (zero) or yes with true and no with false
See this thread for some idea to create dictionaries.
val == “Yes” ? 1 : 0;
This bit of design script should swap the yes for a 1 and the no for a 0.
Yes, I need a node that can replace String.ToNumber; for example, sth like material.byname for material parameter. I just cant figure out which.
Its not a string its a number… remove the double quotation marks( " "). I think for you best approach follow as @jacob.small mentioned.
Try replacing the String.ToNumber to to the DesingScript code Jacob Proposed:
As Steven mentioned in the beginning, you can set a Yes/No parameter with either integer (0 1
) or boolean (true false
).
So the goal is to replace the strings("Yes" "No"
) with either integers or boolean and use that value to set your parameters.
I think this extended way might make it easier to understand why and how to solve something similar in the future
JacobSmalls val == “Yes” ? 1 : 0;
in a codeblock does the same as the green groups, but in a single step. __Vijay pointed out correctly that "1"
(string) is not the same as 1
(integer). You can find a shorthand on how to write different data types in codeblocks here.