How can a nested <Family Type...> be used to drive a conditional statements?

How can a nested <Family Type...> be used to drive a conditional statements?

jjenkins2
Advocate Advocate
1,070 Views
4 Replies
Message 1 of 5

How can a nested <Family Type...> be used to drive a conditional statements?

jjenkins2
Advocate
Advocate

I'm not sure if this is just a syntax error, or if its a "Revit can't do that" issue.

I have a family with nested families that are instance parameters. I would like to make a conditional statement that in essence says this:

If (Family is Type 1) then 3", else 0"

Revit seems to balk at every construct I have come up with to say family/type and I can't find any example with a correct syntax to use as an example.

Can this be done? 

And if so, how is the condition stated?

 

Thanks ever so much in advance.

Jim

0 Likes
Accepted solutions (1)
1,071 Views
4 Replies
Replies (4)
Message 2 of 5

AGGilliam
Collaborator
Collaborator

In order to use family types in a formula you need to have a family type parameter to use in the statement. For example:

Parameters: 

  • Family 1: Corner Trim
  • Family 2: Corner Trim

Statement:

if(Family 1 = Family 2, 3", 0")

0 Likes
Message 3 of 5

barthbradley
Consultant
Consultant
Accepted solution

Are you using Family Type Parameters to control which Nested Family Type is pulled into Family?  

 

If so, this screenshot make sense to you?  "TYPE" is what controls which Nested Family is used in the Family.  "TYPE1" and "TYPE2" are basically just references and, in this example, reference the two Nested Families available to the "TYPE" Parameter. They are needed for the "Length" Parameter Formula to work.  

 

Family Type Parameter.png

Message 4 of 5

jjenkins2
Advocate
Advocate

OK I see how it works, there apparently is no way of directly saying "if ((this parameter is set to this family type), then, else)" so we must make a testing family parameter and compare the two parameter values like this "if ((user selectable parameter family type = test parameter family type), then, else)". The testing parameter can be type and the user selectable parameter instance. 

Message 5 of 5

jjenkins2
Advocate
Advocate
OK I see how it works, there apparently is no way of directly saying "if ((this parameter is set to this family type), then, else)" so we must make a testing family parameter and compare the two parameter values like this "if ((user selectable parameter family type = test parameter family type), then, else)". The testing parameter can be type and the user selectable parameter instance. 
0 Likes