Saturday, November 16, 2013

Controlling User Choices in Families

In November 2005 I wrote post called Make Up My Mind to describe how I could control a series of Yes/No parameters with a single input. I've often wanted to manage this by providing a more meaningful list of choices. A couple years ago I chatted with Jose Fandos of Andekan about this. He's made a lot of content over the years and he pointed out that I could get what I wanted, it just wasn't possible quite as directly as I'd hoped.

Here's a screen capture of the Family Types dialog that I mocked up for a related thread at RevitForum.org.


This technique uses a nested Detail Item family that has three types: Default, Vertical and Alternate. These refer to three preset choices for the orientation of a family.
  • I nested the family into my main (host) family and associated it with a Family Type parameter called Choose Orientation (at the top of the dialog).
  • I created three parameters which are also using the data type Family Type (next 3 down).
  • Each of these is preset to one of the three orientation types in the nested family.
  • I created three Yes/No parameters that will be used to control the visibility or orientation of forms in the host family (group of Toggle parameters).
  • Each Yes/No parameter is mapped via a formula that, (in a counter-intuitive "IF" statement format) stated in plain English, equates to "If Choose Orientation = Set Condition A,B or C then my parameter value is True".
  • I can use each one of the Toggle parameters to control other elements all based on the user selection for Choose Orientation.
The middle man Set Condition "x" parameters are necessary because a Yes/No formula can't evaluate the Choose Orientation parameter value directly in the formula column. When the user encounters this family they just use the Choose Orientation parameter to decide which orientation is appropriate. Everything else adjusts based on this choice.

Download the Example Family

2 comments:

David N said...

Hi there,

Your workaround seems perfect, but when I set the condition to the visibility (for example: If Choose Orientation = Set Condition A) I get the error "Improper use of boolean expressions"

Do you have any idea why?

Thank you in advance.

BR,
DN

Steve said...

Hard to say without seeing the family or the parameters in play. Did you download the example family? Syntax matters a lot, uppercase, lower case, parenthesis etc.