Change Nested Family Type Instance Parameter


#1

I have a door family with a nested family inside that indicates swing angle (45, 90, 180…). Each angle is a different family that is ties to a parameter called “Swing Angle” so they’re not strings values. Can someone point me in the direction to be able to change all nested families in a Revit project from say “90 Degrees” (actual nested family name) to “45 Degrees” for the swing angles. I’d like to avoid selecting each door.

BTW the Swing Angle parameter is an instance parameter.

Thanks!


#2

When you get the parameter value for the “Swing Angle” what do you see?


#3

Thanks for the reply. I’m having trouble getting the value in Dynamo. The actual value could be one of three nested families. “90 Degrees”, “45 Degrees”, or “180 Degrees”


#4

If you want to get the values of parameters of nested families, let them be controlled by parameters of the parent family and read those out.
Revit doesn’t really work the other way around, and I’m not sure how you’d be supposed to get these with Dynamo either.


#5

Thanks. They are controlled by the parent family via a “Swing Angle” parameter.


#6

Then it shouldn’t be a problem to simply find them by using the Element.GetParameterValueByName node.


#7

Thanks. Does it matter that the parameter is an instance parameter? “No parameter found by that name.”

Attaching image…


#8

It shouldn’t matter if it’s in instance in that case, as you should be dealing with instances there not types. Can you share a basic .rvt with a minimal number of doors in it?


#9

You’re cunnrently setting the value as a string, that barely ever works, it accepts the value 45 as degrees.

I vaguely got the idea that the different angles are different nested families, and the type is set through a parameter, if so, use the FamilyType.ByName node to get the family, the Element.SetParameterByName node accepts that as a value input.


#10

That is getting the parameter value but as soon as I plug in the string value “45 Degrees” (which is probably the wrong thing to do) the Element.SetParameterBy Name blows up. Dereferencing a non-pointer error.


#11


#12

Try to find out, what kind of parameter you have:


#13

Thanks. Got it. Not sure what to do with the information though.


#14

So the parameter storage type is a element id, and you try to fill in a string, this will not work


#15

Right, different data types. Any ideas how I swap one “Swing Angle” value for another? 90 Degrees to 45 Degrees know it’s not a string?


#16

You need to find the element ID of the swing angle family which you want to use. If you post the .rvt file as I previously requested this will speed things along.


#17

Hmm… I missed that. Thanks. Will do tomorrow morning. Thank you!


#18

Here it is. Thanks Jacob!

TestFile.rvt (2.7 MB)


#19

I’ll try and squeeze this in tonight. No promises though.


#20

I understand. Thank you.