formula for a yes/no parameter depending on length an an other yes/no parameter

formula for a yes/no parameter depending on length an an other yes/no parameter

Anonymous
Not applicable
7,391 Views
5 Replies
Message 1 of 6

formula for a yes/no parameter depending on length an an other yes/no parameter

Anonymous
Not applicable

Hi,

I'm trying to make a formula for a yes/no parameter which is depending on other yes/no parameters AND a dimension value.

I have an dimension parameter: railing_diepte
a 1st yes/no parameter: b_aantal_spillen_diepte
a 2nd yes/no parameter: b_baluster zichtbaar_diepte midden

Basically what I want for the 2nd yes/no parameter is:
1. to be turned OFF when the 1st yes/no parameter is ON
2. to be turned ON when the 1st yes/no parameter is OFF
3. to be turned OFF when the dimension parameter is less then a particular value (in this case: <200mm)

how can I put this in a formula?? I've added a screenshot to show you guys how far I got with this.

I've searched this forum and others, but no result. Thanks a lot to the guy/girl who can help me!!

0 Likes
Accepted solutions (1)
7,392 Views
5 Replies
Replies (5)
Message 2 of 6

Keith_Wilkinson
Advisor
Advisor
Accepted solution

Sorry, don't have time to look at this in detail but this should get you fairly close I think.

 

The ControllingInteger takes care of the various combinations via a nested if statement - so condition of your first yes/no parameter and the length of the wall.

 

The second Yes/No parameter is then controlled by an if statement based on that integer value - so if it's '1' then the answer is False 1>2 which will set the parameter to No and if it's '0' the answer is True 2>1 which will set the parameter to Yes.

 

Let me know if this helps or if you get stuck.

 

K.



"Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime."
Maimonides
Message 3 of 6

Anonymous
Not applicable

Thanks! you're sollution almost worked,I changed a few things on the integer parameter so the family acted the way that I wanted:

Yes-no_parameter formula 2.JPG

 

Although I still have to figure out what the formula behind the integer and the ParamB parameter means.. Do you want to explain that one to me please?

 

Really appreciate your help!

0 Likes
Message 4 of 6

Keith_Wilkinson
Advisor
Advisor

One of the best resources for formulas is here : 

 

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

 

I've just used a selection of bits to give you what you are after.  But in essence the Integer Parameter first checks the condition of ParamA, if this is checked it returns 1 if it's unchecked it returns 0.  Then it checks the wall length, in my case if it's greater than 500mm it returns 1 and if it's less it returns 0, for any other condition it returns 0.

 

You now have a parameter which is either 1 or 0 nothing else.  So now we use this to drive ParamB - If the value of the integer is 1 we want it to be unchecked or 'False' so we use 1>2 (as 1 is less than 2 this statement is false) for any other condition (which can only be zero) we want the box to be checked or 'True so we use 1<2 or 2>1 (both these conditions are true so either would work).

 

If you wanted you could make it a lot more complex but there is not need in this example thankfully as nested 'If' statements can get quite complicated!



"Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime."
Maimonides
Message 5 of 6

Anonymous
Not applicable
Thanks!
I always wondered how a checkbox (yes/no parameter) is reflected in a formula. I never could just write 'false' or 'true', but 1>2 and 1<2 does the trick so it seems.. That's pretty weird!!

Thanks! you made my day
0 Likes
Message 6 of 6

Keith_Wilkinson
Advisor
Advisor

You're welcome - happy to help.  

 

I agree, it's always felt like an oversight on the part of ADesk that True / False aren't included - there may be a good reason for it though but at least there is a workaround which is pretty easy.



"Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime."
Maimonides
0 Likes