How to set 'Formula' for parameters in family

Hi,

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.

Thanks

Vasu

Hi,

Anyone could help me on above query, please.

Thanks

Vasu

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

1 Like

Hi @Mostafa_El_Ayoubi,

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

Thanks

Vasu

4 Likes

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

1 Like

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.

3 Likes

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?

Tim

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

Hi to all, I’m trying to create a script to add some shared parameters to a family, and add a formula for each parameters.
I put all the info in a csv file, comma separated. Column value are:
(see attached img)


SP Name (name of the parameter)
SP Group (group of the shared parameter file)
Pgroup (type of the parameter eg: PG_IDENTITY_DATA)
Instance (Y/N if parameter is instance or not)
Formula (value of the formula I want to put for each parameter)

I’ve tryed to use the node "FamilyParameter.SetFormula) but I can’t find a way to put it in the right way…
I’m very new in coding with Dynamo so I don’t know very well how to do this…
Could anyone help me?
Many thanks.
SharedParam_to_family_SIMONE.dyn (46.7 KB) ![CSV_file|690x98]