Revit Formula - if yes/no checked, then override value, else use entered value

Revit Formula - if yes/no checked, then override value, else use entered value

Anonymous
Not applicable
3,762 Views
12 Replies
Message 1 of 13

Revit Formula - if yes/no checked, then override value, else use entered value

Anonymous
Not applicable

I have 3 instance parameters, call them yn, val1, val2. Val1 and val2 each control the height of a different element in a family. I want y/n to control whether they are aligned or can move independent of one another. I know this is can be done by creating an extra parameter to use as a placeholder for the override value (e.g. val3 = if(yn, val1, val2)), but I'd like to avoid wasting a parameter if possible.

 

TL;DR  is there a formula function for overriding a parameter value? -> val2 = if(yn, val1, val2) returns circular reference error.

 

Thanks

0 Likes
Accepted solutions (1)
3,763 Views
12 Replies
Replies (12)
Message 2 of 13

barthbradley
Consultant
Consultant

@Anonymous wrote:

I have 3 instance parameters, call them yn, val1, val2. Val1 and val2 each control the height of a different element in a family. I want y/n to control whether they are aligned or can move independent of one another. I know this is can be done by creating an extra parameter to use as a placeholder for the override value (e.g. val3 = if(yn, val1, val2)), but I'd like to avoid wasting a parameter if possible.

 

TL;DR  is there a formula function for overriding a parameter value? -> val2 = if(yn, val1, val2) returns circular reference error.

 

Thanks


Not clear.  You have 4 Parameters don't you? I mean there's a Parameter that accepts either val1 or val2 depending on the status of y/n; right?    

 

...can you post a picture or something? Also, will this question on the finals?  Smiley Wink

0 Likes
Message 3 of 13

Anonymous
Not applicable

@barthbradley

 

I know I can accomplish what I want using 4 parameters, just wondering if its possible with only 3.

0 Likes
Message 4 of 13

barthbradley
Consultant
Consultant

Don't know. Need more info. I work best when illustrations accompany the explanation. 

0 Likes
Message 5 of 13

Anonymous
Not applicable

20180814_133958.jpg

Message 6 of 13

ToanDN
Consultant
Consultant

@Anonymous wrote:

I have 3 instance parameters, call them yn, val1, val2. Val1 and val2 each control the height of a different element in a family. I want y/n to control whether they are aligned or can move independent of one another. I know this is can be done by creating an extra parameter to use as a placeholder for the override value (e.g. val3 = if(yn, val1, val2)), but I'd like to avoid wasting a parameter if possible.

 

TL;DR  is there a formula function for overriding a parameter value? -> val2 = if(yn, val1, val2) returns circular reference error.

 

Thanks


 

Message 7 of 13

barthbradley
Consultant
Consultant

LOL! Thanks for the detailed illustration, @Anonymous.  I'm dropping the class. Home Economics here I come. 

Message 8 of 13

Anonymous
Not applicable

@ToanDN

So, to be explicit, no there is no function for that; yes you have to use 4 parameters?

0 Likes
Message 9 of 13

barthbradley
Consultant
Consultant
Accepted solution

Yes; that is correct. Promise. 

 

 

...however...you can NEST if statements.  

 

 

...I've had a hardcopy of this pinned above my workstation for years:  

 

https://www.revitforum.org/tutorials-tips-tricks/1046-revit-formulas-everyday-usage.html

Message 10 of 13

Anonymous
Not applicable

Great resource, much thanks!

Message 11 of 13

dani52g7
Explorer
Explorer

Hi, any chance you still have a hard copy? I can't reach the link... Thank you!

0 Likes
Message 12 of 13

ToanDN
Consultant
Consultant

@dani52g7 wrote:

Hi, any chance you still have a hard copy? I can't reach the link... Thank you!


https://www.revitforum.org/node/1126

0 Likes
Message 13 of 13

jfiferMJ4ME
Participant
Participant

Did you ever solve This? Even still, I have to use an extra parameter, which kills the instance ability to move with draggers, and gets confusing when the distance location parameter reads wrong (because its value isn't being utilized while the sink is centered. Trying to have a sink countertop family that can be centered with a button, but can be free when it's unchecked. Currently it is: if(Centered Sink, Length / 2, Sink Location)

Ideally, this would be the formula for Sink Location parameter.

0 Likes