Formula-driven Family Type parameter.

Formula-driven Family Type parameter.

Anonymous
Not applicable
16,049 Views
17 Replies
Message 1 of 18

Formula-driven Family Type parameter.

Anonymous
Not applicable

In my Family I have a parameter of type <Family Type>. I want it to be controlled by a formula. I have problems with defining this formula. For the simplest example i just copy the whole name of family and the type and paste to the formula field. I receive an error (see picture below). What is the correct way of typing type names into the formula field?

family type parameter.png

Accepted solutions (1)
16,050 Views
17 Replies
Replies (17)
Message 2 of 18

Sahay_R
Mentor
Mentor

The highlighted item in the screenshot is what really needs to be in the formula. Watch out for cases and typos!

Capture.JPG


Rina Sahay
Autodesk Expert Elite
Revit Architecture Certified Professional

If you find my post interesting, feel free to give a Kudo.
If it solves your problem, please click Accept to enhance the Forum.
0 Likes
Message 3 of 18

Anonymous
Not applicable

Thank you for your reply, but could you please be more specific about the syntax? I was trying different Options (for example Abtropfbrett Typ<IPN_Abtropfbrett : 300 mm> but nothing works.

0 Likes
Message 4 of 18

Sahay_R
Mentor
Mentor

Parameters are all in the extreme left column. From your screenshot, it appears that the formula includes information from the middle column. If I am incorrect, then a clearer screenshot with the error message moved away from the dialog box would be appreciated.

 

Here's how parameters are organized in the dialog box- 

 

1) Left column = Parameter

2) Middle column = Parameter Value

3) Right column = formula, if any

 

The Formula is made out of Parameters, which will come from the left column.


Rina Sahay
Autodesk Expert Elite
Revit Architecture Certified Professional

If you find my post interesting, feel free to give a Kudo.
If it solves your problem, please click Accept to enhance the Forum.
0 Likes
Message 5 of 18

Anonymous
Not applicable

You're right. In the formula field I tried the simplest possible way of assigning Parameter value using a formula. If the Parameter type would be let's say Integer, then if in formula field I would type "500", the Parameter Value would be set to 500. Apparently Family Type Parameters require different Syntax of formulas which is unknown to me.

Unbenannt.png

Message 6 of 18

Sahay_R
Mentor
Mentor

What exactly is it that you want your formula to do?


Rina Sahay
Autodesk Expert Elite
Revit Architecture Certified Professional

If you find my post interesting, feel free to give a Kudo.
If it solves your problem, please click Accept to enhance the Forum.
0 Likes
Message 7 of 18

Anonymous
Not applicable

I want the parameter value equal IPN_Abtropfbrett : 300 mm if the value of Lenght is over 300 and  IPN_Abtropfbrett : 600 mm otherwise.

 

Normally it would be something like if(Lenght>300,"IPN_Abtropfbrett : 300 mm","IPN_Abtropfbrett : 600 mm")

0 Likes
Message 8 of 18

Alfredo_Medina
Mentor
Mentor
Accepted solution

Family Type parameters cannot be set to a formula in a simple way. You need more parameters, one Family Type parameter for each variation, and one integer parameter to define which variation.

 

There is an example of this technique in "Exercise # 6" of this article that I posted in Linkedin:

 

https://www.linkedin.com/pulse/repetitions-randomness-revit-part-2-alfredo-medina/

 


Alfredo Medina _________________________________________________________________ ______
Licensed Architect (Florida) | Freelance Instructor | Profile on Linkedin
Message 9 of 18

Alfredo_Medina
Mentor
Mentor

Hello,  @Anonymous

 

Just curious, what was the end of this case? 


Alfredo Medina _________________________________________________________________ ______
Licensed Architect (Florida) | Freelance Instructor | Profile on Linkedin
Message 10 of 18

Grigor_Panosyan
Participant
Participant

The way you suggested in exercise 6 doesn't seem to work, I have tried to recreate the Hexagon family exactly as it is displayed in the Type Properties, but all I get is "The following parameter is not valid" after inserting the formula. I want to find out the right way of connecting Integer and Family Type parameters via a formula, but, unfortunately, I have no luck doing it. 

Message 11 of 18

Peter.Banski
Observer
Observer

Thank You Alfredo,

 

Your Link is the one and only solution in the whole WWW that I found, how to steer "Family Type Parameter" with a Formula.

 

And it works very well!

 

Peter

 

Message 12 of 18

Alfredo_Medina
Mentor
Mentor

@Grigor_Panosyan wrote:

"The way you suggested in exercise 6 doesn't seem to work, ..."

_________________________________________________

 

Please try again. It does work.


Alfredo Medina _________________________________________________________________ ______
Licensed Architect (Florida) | Freelance Instructor | Profile on Linkedin
0 Likes
Message 13 of 18

Grigor_Panosyan
Participant
Participant

Dear @Alfredo_Medina,  it does work like a charm, indeed I was doing something wrong back when I posted my reply.

Integer x Double Family Type x "if" statement became one of my favorite technics 

 

Message 14 of 18

Roberto.CabanasEPSPH
Observer
Observer

Great!!! Brilliant explanation and technique.

0 Likes
Message 15 of 18

jquarry
Enthusiast
Enthusiast

Is this still the best (and only) way to drive Family Type Parameters in formulas?

 

Now that it is 2022 I figured I might save someone some time doing any additional searching...

0 Likes
Message 16 of 18

Alfredo_Medina
Mentor
Mentor

Hello, @Peter.Banski and all of you participating in this thread. I want to add that I have made a video about this topic, how to control family types by formula, plus another topic, how to apply random values to those family types. If you're interested, please follow this link:

 

https://www.youtube.com/watch?v=_8Md-Vrw8PU


Alfredo Medina _________________________________________________________________ ______
Licensed Architect (Florida) | Freelance Instructor | Profile on Linkedin
Message 17 of 18

adriansin_randalllamb
Participant
Participant

Adding to @Alfredo_Medina  's solution. The formulas also work with Yes/No checkboxes. Yes/No checkboxes can be more intuitive for users. Thank you so much for the solution.

 

adriansin_randalllamb_0-1696447339802.png

 

Message 18 of 18

Rafael_Lucki1
Explorer
Explorer

don't use this type family parameter, use visibility parameter to turn of other familys nested on you main because it does work better to write formulas