How to set 'Formula' for parameters in family



I need to set a value to ‘Formula’ field for some parameters in a family. I just tried using the script for setting ‘Value’, by replacing p.Definition.Name by p.Formula. But no luck. I am totally new to Python, though.

Can anyone please let me now how to do this.





Anyone could help me on above query, please.




Hi @Vasu ,
I’m affraid Formulas can’t be set through API :

Extract Parameters' formulas

Hi @Mostafa_El_Ayoubi,

Thanks for responding. I tried the below script and it worked.



Create Parameters in a Revit Family

Nice! Sorry for the misleading info :grin: . Maybe it got you looking elsewhere at least…


Have just noticed this post… I have several nodes that can be used for working inside family documents… that can be used in combination with Rythm node for open and close.


Erik, I have made good use of your nodes to set family parameters and it’s very handy in editing folders full of families, so Thank you very much for that. But I cannot figure out how to use the one that sets a formula.

In this example the parameter is a simple yes/no box, but I have tried it with numerical paramaters as well. Am I doing something wrong?



Please start a new post… and please update your package, it is old :slight_smile: