Revit formula with multiple conditions - How to write

Revit formula with multiple conditions - How to write

Jessicas
Advocate Advocate
10,185 Views
10 Replies
Message 1 of 11

Revit formula with multiple conditions - How to write

Jessicas
Advocate
Advocate

HI,

 

I have a family i'm creating and there's a nested item that needs to be visible under certain circumstances.

Its a U-Shaped family, the sides are visibly controlled by yes/no parameters

 

There's a centre support that needs to be visible if the length gets to 8' or above.

 

So this is what I the conditions need to be...

 

Centre support visible if Length_Main > 7'11"

but if the Left side is visible the necessary length would be 7'11 + 1'4"

if the Right side is visible length would also be 7'11 + 1'4"

if Both sides are visible length would be 7'11" + 2'8"

 

does anyone know how this would be written. I'm definitely not good with writing the formulas.

 

Thanks in advance if anyone can show me how the formula would look.

0 Likes
Accepted solutions (1)
10,186 Views
10 Replies
Replies (10)
Message 2 of 11

ToanDN
Consultant
Consultant

Please share the family file.

0 Likes
Message 3 of 11

Alfredo_Medina
Mentor
Mentor

You need to build a formula that checks for those things in order, from left to right, like this:

 

  • first, check if Left is visible and Right is not.
  • If that is true, do this,
  • if not
  • check if Right is visible and Left is not,
  • if that is true, do this,
  • if not,
  • check if both Left and Right are visible
  • if that is true, do this,
  • if not,
  • use a default or base length.

 

That sequence, translated to a formula, is like this:

 

2017-03-23_18-01-06.png


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

ToanDN
Consultant
Consultant

My shot at it.  See if I am missing any conditions.

 

Capture.PNG

 

 

Capture1.PNG

 

 

Capture2.PNG

 

 

Capture3.PNG

 

 

Capture4.PNG

 

Message 5 of 11

Jessicas
Advocate
Advocate

Sorry I was able to post this right at the end of my work day. 

0 Likes
Message 6 of 11

Jessicas
Advocate
Advocate

Can anyone help with this? I've tried quite a few times to get something but i always get errors.

0 Likes
Message 7 of 11

ToanDN
Consultant
Consultant

Have you tried the formula provided by @Alfredo_Medina and the other one by myself?

0 Likes
Message 8 of 11

Jessicas
Advocate
Advocate

I tried Alfredo's it seems more towards what i think i need. I tried so many things with it and couldnt get anything to work. 

Yours.... honestly i have to idea whats going on 😮 really truely i suck at formula stuff

 

I attached the family in an earlier reply maybe it will help if people see the actual family set up.

0 Likes
Message 9 of 11

ToanDN
Consultant
Consultant

We use different approaches to reach the same goal.  @Alfredo_Medina created one complex formula that does it all where as I decided to break it apart.  I showed screenshots of multiple conditions so you could see how the formula works.  It's up to you which one you select.

0 Likes
Message 10 of 11

Jessicas
Advocate
Advocate

ok. Well I've had to move on so once I get back to that family I'll try your version out and see if i can get it to work.

0 Likes
Message 11 of 11

ToanDN
Consultant
Consultant
Accepted solution

Here is my attempt at your family.  Obviously my brain is not as good as @Alfredo_Medina so I needed to add a few more parameters in order to make it work.  His original proposal should work if you can digest it.

 

Capture.PNG