Change Nested Family Type Instance Parameter

If your door swings are nested families then you should be able to query them directly. Since the doors are controlling the swing type you won’t be able to change the angle in the swing family, but you should be able to find all the door swing families/types and use those as the parameter value for your door instances.

Something like this should work:
image
Edit: Sorry, I was thinking your nested families were shared. This assumes that you have shared families so you can query the door swings directly from the project.

Hi Nick. Thanks. The goal is to swap one nested family for another. 90 to 45…

Within Revit, when editing a family, you can set the type of a nested family as a parameter as well, you can control that with Element.SetParameterByName node, but the value input should be a family type then.

Correct. And if I’m understanding everything your Door families have a parameter Swing Angle that selects the nested family (45, 90, 180…). In order to change the swing of your door you would have to change the Swing Angle parameter value to that of the nested Door Swing family you want to use. This is assuming your Door family is set up with a family type parameter like @PauLtus referenced.

1 Like

That is correct. The “Swing Angle” parameter is an instance parameter. I don’t know if that matters.

That matters a lot, it means the input can’t be a string, value, boolean or integer, but has to be a family type. Try to get it with the FamilyType.ByName node.

It doesn’t matter that it’s an instance parameter. It matters that the parameter is a family type.

Err, I was wrong there, it does actually matter though; It’s going to influence whether a single element gets changed when you changed or every element of that type in the file.

I’m looking to change every element from 90 to 45. The same family is nested into my various door families.

Then, make sure it’s a type parameter.
Load in the family type of the parent family in the “element” input, and the family type of the door into the “value” input of the Element.SetParameterByName node.

Hey Paul,
Hmmm… I can’t really make it a type parameter. I’m attempting to create a dynamo script that will change the swing angle to indicate that all doors are existing (45). However I will use the same family for new work and need to set those to 90. If I made “Swing Angle” a type parameter Id’ have too my types in each door family.

It can stay an instance parameter. That’s why you would use All Elements of Category to get all Door families in your project and change each one of them to the 45 Door Swing. Then all your new doors could be set to 90.

@BBDCW load your nested families (45 and 90 degrees familiy) directly into your project. Having those families in your project allows you to set the “swing angle” parameter as you wish.

Btw: just out of curiousity: why don’t you make the “swing angle” a shared family instead of a nested family?!
Or even better: make one nested family which represents all of the possible angles (so that angle is an instance value of that nested swing-family).
So
Door-family
– nested swing-family with instance ‘angle’ parameter.
– instance angle parameter connected as instance parameter of your door-family
– now you can change the angle value to set the door swing (no need for shared families, loading families into your project etc.etc.)

Thanks 3Pinter! That worked as long as I loaded the “45 Degree” and the “90 Degree” families. the problem with doing that is I have used the same names (45 Degrees & (90 Degrees ) for single and double doors. If I load them only one can survive since the single will get overridden when I load the double version. I’d prefer a method that wouldn’t require me to rename the nested versions in all my door families if possible.

If I’m understanding you correct I’m pretty sure that’s what I have already. The family is in the rvt file I uploaded if you want to look at it. Thanks.

“Door-family
– nested swing-family with instance ‘angle’ parameter.
– instance angle parameter connected as instance parameter of your door-family
– now you can change the angle value to set the door swing (no need for shared families, loading families into your project etc.etc.)”

@BBDCW, you are welcome.

Please have a look at the altered rvt file I’ve attached. A different approach.

Now selecting a door:

  • instance property @ model properties:swing_angle. enter a number between 0 and let’s say 90. and the door swing will change.
  • only one nested family does that.

Now: if you want to use dynamo to change it: easy peasy.

TestFile.rvt (1.6 MB)

Wow thanks for taking the time to do that for me. I appreciate it. Unfortunately I tried that approach a few years back. I had lots of problems with the swing angle when the angle was more than 150 degrees. Your version also suffers from the same problem. It ends up looking like pacman. See attached image.

Over%20150%20degrees

Haha. pacman ftw!

By no means was I trying to improve your family. As I would do things different. I was just trying to show an easier way how to do things.

But, fixing that isn’t a problem, label the curve and you are good to go, see attached (oh and swing line is hidden if angle is 0, which is cleaner).
I think this would solve this topic enough.

TestFile.rvt (1.5 MB)

1 Like

Hi 3Pinter,
If I change my door families your solution works perfectly. Kind of hoping not to have to do that. I will wait another week or so. If no other replies have a different solution I’ll check yours and close the thread.

Thanks!

I would rename your families to be 45 Degrees Single and 45 Degrees Double (or something similar). As a best practice this should be done to prevent confusion on the users end and Revits end. You would then be able to make all the swing angles shared families (preventing you from having to load each one into your model). I would then get each doors current family type parameter and check to see if the name contains “single”. If true change the family with a single swing type and if false change it with a double swing type.