Design Ideas for the Built World

View Original

Using Formulas with Nested Family Type Parameters

Editor’s note: This post was originally published on EvolveLAB's blog and re-published here with permission.


Recently, we ran into a unique problem when building some parametric window families for a client. We had a family that had various nested components that were associated to the parent family by <Family Type…> parameters. 
HOW TO USE <FAMILY TYPE…> PARAMETERS TO CALCULATE VALUES IN THE FAMILY TYPES DIALOG

Let’s take a window family for example:

STEP 1:
We have an associated parameter called, “Head Trim Type”, and this parameter is a <Family Type…> parameter. The nested ‘Head Trim Type’ Family, has 3 types: A, B, C.

When this window family is loaded into a project, the end-user will have the option to change the trim style by way of a drop down in the project’s properties interface. Great!

Now, the only issue is, depending on the Head Trim style, the Jamb Trim Width will be changing. Sounds like an IF-THEN statement.

STEP 2:

We then create three different <Family Type…> parameters, We’ll call them, “Head Trim Type A”, “Head Trim Type B”, and “Head Trim Type C”. Then we set their values to the respective Head Trim Types in their drop down boxes (Head Trim Type A = Head Trim Type_EvolveLAB: A, … and so on). See Below:

STEP 3:

Now in our Jamb Trim Width parameter, we will create our IF-THEN statement:

if(Head Trim Type = Head Trim Type A, 0'  3", if(Head Trim Type = Head Trim Type B, 0'  4", if(Head Trim Type = Head Trim Type C, 0'  5", 0'  3")))

Now you have your formula, and it’s running its calculations with the <Family Type…> parameter!

STEP 4 (OPTIONAL, RECOMMENDED):

A good trick now so that the end-user doesn’t go switching the Head Trim Type options you set up strictly for the formula calculation, is this:

You modify the parameter “Head Trim Type A” → “Head Trim Type A (DO NOT EDIT)”. The formula will automatically update to this new name.

Try and use the parameter name “Head Trim Type A (DO NOT EDIT)” in the formula back in STEP 2 (…there are subtle necessities that cause this to fail).

Good Luck! Feel free to shoot any comments or questions over in the chat on EvolveLAB's blog.