Selecting nested families from a family to join them

Hi everyone,

I’m trying to join the nested families (profiles) of a window (family) with a dynamo script. the problem is that it takes too long and it is unpractical for large projects. it basically takes all the profiles and cross references a list of the profiles and attempts to join them if possible.

This I an inefficient way of going through the list. What I think would make this script a lot faster is to put the nested families (profiles) of a parent family (window) in a list. So I should get a list of lists like:

[[profile1, profile2, profile3],[ profile1, profile2, profile3],[ profile1, profile2, profile3],…].

I cannot figure out how to implement this, does anyone know how to solve this?

first open the family
start dynamo
make the joins
save
load the family

This does not work, because when I place the family(window) in the project, revit reconstructs the family with the nested families. So you will always get unjointed nested families. Even when I join them in the parent family.

In the families, associate an instance parameter (I’ll call it ‘host mark’ for now, but use whatever you like) in the nested family with a parameter in the host family.

Then get all the profile family elements.
Then get the ‘host mark’ value for each element.
Then group the elements by the ‘host mark’ value.
Lastly perform the join operation at the sublist level.

This won’t be perfect as you could have elements running parallel but not touching. I do t have your families so I can’t say what is beat, but sorting by directionality (get a vector for each line based profile family and ask if there is a Z component), or an additional parameter value (V for vertical profiles, or even number them in the families) at the sublist level could help that aspect.

1 Like