REVIT MULTIPLE IF CONDITIONS WITH 3 PARAMETERS

REVIT MULTIPLE IF CONDITIONS WITH 3 PARAMETERS

3646297NWX
Explorer Explorer
1,356 Views
13 Replies
Message 1 of 14

REVIT MULTIPLE IF CONDITIONS WITH 3 PARAMETERS

3646297NWX
Explorer
Explorer

Hi Everyone, 

 

I wanted to create a formula with 3 visibility parameters and it would only allow the selection of one item at a time (deselecting the others).


For example,
If Attention Checked, not (OK) not (Pending)
If OK Checked, not (Attention) not (Pending)
If Pending Checked not (OK) not (Attention )

 

Captura de tela 2024-11-18 075819.png

 

 

try this, but not work for me.

https://www.autodesk.com/br/support/technical/article/caas/sfdcarticles/sfdcarticles/PTB/Set-yesno-f...

 

Any help or suggestions will be appreciated.

Thanks in advance.

0 Likes
1,357 Views
13 Replies
Replies (13)
Message 2 of 14

RC_RVT
Advocate
Advocate

So you need 3 yes/no parameter that can be adjusted like you have. These are not assigned to anything because they could be done wrong by the user.

 

You then have 3 yes/no parameters, (attention_, ok_, pending_) that are assigned or are essentially the correct/working parameters, if that makes sense.

 

You cannot use your formulas you have put in.

 

Use the following formulas for each parameter you have:

Attention = and(not(OK),not(Pending))

OK = leave empty as you have done

Pending = leave empty as you have done

attention_ = Attention

ok_ = and(OK,not(Pending))

pending_ = and(Pending,not(OK))

 

 

0 Likes
Message 3 of 14

3646297NWX
Explorer
Explorer

It didn't work. The user is able to select two options at the same time (OK and Pending). Only one option can be selected at a time (Attention, OK, or Pending).

0 Likes
Message 4 of 14

3646297NWX
Explorer
Explorer
It didn't work. The user is able to select two options at the same time (OK and Pending). Only one option can be selected at a time (Attention, OK, or Pending).
0 Likes
Message 5 of 14

ToanDN
Consultant
Consultant

Your formulas are running in circle.  For more than 2 parameters, use Integer instead of Yes/No.

1 = attention

2 = ok

3 = pending

Message 6 of 14

RC_RVT
Advocate
Advocate

Yes, like I said these are the face value options, in the background the "actual" yes/no parameters will control this as they will only turn on if the correct boxes are ticked. I don't know what you are using these for, but I use them all the time in families I create, and yes you can select the wrong boxes, but the background parameters keep this all controlled. If you are only using this for selection purpose and it's not controlling a family, use an Integer as ToanDN has said.

 

if you want to use these parameters as you have shown, use the following which I have adjusted:

Attention = attention_

OK = leave empty as you have done

Pending = leave empty as you have done

attention_ = and(not(ok_),not(pending_))

ok_ = and(OK,not(Pending))

pending_ = and(Pending,not(OK))

 

The attention_, ok_ & pending_ parameters will control the model so that if both OK & Pending are ticked, as you have said, attention_ & Attention will automatically tick therefore highlighting that there is an issue.

0 Likes
Message 7 of 14

RC_RVT
Advocate
Advocate

See above video, I have also created an Alert text parameter that displays text if there is a change required.

ALERT = if(Attention, "CHECK OK & PENDING CHECK BOXES", "")

0 Likes
Message 8 of 14

3646297NWX
Explorer
Explorer
With the code above, the user is able to select 2 items. This should not happen; the status should only be 1 item, just like a radio button in HTML.
0 Likes
Message 9 of 14

azad.Nanva
Advisor
Advisor

if i understand well,use this:

 

azadNanva_0-1732717291387.png

 

If it solves your problem, please click Accept to enhance the Forum.
0 Likes
Message 10 of 14

RC_RVT
Advocate
Advocate

Like we are saying, if you don't want the option to be able to select 2 buttons then use ToanDNs method. There is no possible way for only one button to be selected using the method you were wanting.

"If you are only using this for selection purpose and it's not controlling a family, use an Integer as ToanDN has said."

0 Likes
Message 11 of 14

azad.Nanva
Advisor
Advisor

but in my solution is just one button must selected.

If it solves your problem, please click Accept to enhance the Forum.
0 Likes
Message 12 of 14

RC_RVT
Advocate
Advocate

In your solution you can still select both OK and Pending at the same time I believe. This is something that they don't seem to want to be able to do. In my solution it has the same outcome as yours.

0 Likes
Message 13 of 14

nozci
Advocate
Advocate

This can't be done more than two parameters. Basically, what you want is radio buttons but this requires a parent class controlling checking status of the buttons like 1 2 3 which brings you to Toan's solution.

 

There is no such mechanism in Revit as far as I know, may be internal but not to the user.

Message 14 of 14

TripleM-Dev.net
Advisor
Advisor

Like @ToanDN mentioned , if you have mutliple choices and only want user to be able to pick specific combination use a integer parameter which controls the conditions.

 

So if you have 3 conditions (or more..),  use:

 

Option_selection (integer, also add a tooltip desc. the values)

 

Condition 1 = or(Option_selection = 1, Option_selection = 2)

Condition 2 = or(Option_selection = 2, Option_selection = 3)

Condition 3 = or(Option_selection = 3, Option_selection = 1)

Condition 4 = or(Option_selection < 1, Option_selection > 3) <= I also always include a default or alternative it none of the valid values is entered.

 

Bonus for this, it's scalable, with a bunch of Yes/No parameters it's going to be a mess to edit something later on.

0 Likes