Copying Parameters from one open family to another

Hi,

I am trying to copy parameters from one open family to 10 others. I want to use RiR for this because I am updating a whole series of families and adding the same parameters to all of them, so it would be a lot easier to just have a script that does it. This is also a common problem that comes up.

My initial thought was to query the parameters in the families I’m copying too, and cross reference with the family that I am copying from; then filter out all of the parameters that are already the same; then create new parameters based on the remaining parameters. However, the query parameters component doesn’t have a filter input. Is there a way to do what I’m looking for?

Also, is it possible to copy any formulas that the parameters have?

Hi Liam,

You can do your filtering logic by testing for the parameter Name.

There is a Parameter Formula component.

This is very helpful, thank you.

The “Open Documents” node is not working for me. I have two families open, but this is what’s happening.
image

Can you provide your About info? Thanks

image

I’m running into another problem.

I saw something earlier that I can’t seem to find or replicate (I think it was a runtime warning) that said that the parameter formula component is pulling from the active document, rather than from the document that the parameter is from. I then made sure to run the script while I was in the family I am copying FROM, and it still didn’t work.

Is the formula in a type or instance parameter?

It’s a type parameter. I also realized that I was not defining the scope when creating the new parameter. I did define it as a type parameter and I am getting the same error.

Maybe this will help.

I recreated your scenario with full success, please post a small example with your issue. Thanks

1 Like

I tried the solution and got the same error.

Family Getting Parameter 1.rfa (1.9 MB)
Copying Parameters to Other Open Families.gh (17.3 KB)
Family Getting Parameter 2.rfa (1.9 MB)
Family With Parameter.rfa (1.9 MB)

Per the error add a Type to the Families that are receiving the the parameters.

Not sure if this is a bug or Revit API requirement for such a workflow. I’ll add a bug report and we’ll investigate.

That worked! Thank you for helping and for the bug report.

On a related note, is it possible to set all of the parameters of a family while editing that family? For example, I am editing a family with 30 types and I add a visibility parameter. I want to change the visibility parameter for all 30 types at once, without having to go to each type separately and manually change the value. When I try and query parameters with RiR, it does show all the parameters in the family, but I can’t change the value of the parameters because the Element Parameter node requires an element input. Is there a different node I can use, or a way to give the node an element?

Changing the Type parameter requires a Type Element.

As you can see below the Family Document behaves differently and doesn’t return the types with the Family Types component.

In a project environment you can get the Type Element and change the parameters like so…

So, is there any way to set the value of a parameter in an open family? Below, I have a door family open and would like to set the value of all of the ratings parameters to be 1. Is that possible?

The Family Document requires separate components, so not possible at this time. There is a feature request in the queue.

1 Like