"If" formula in Yes/No parameter - is it possible?

"If" formula in Yes/No parameter - is it possible?

Redrunner92
Collaborator Collaborator
6,194 Views
5 Replies
Message 1 of 6

"If" formula in Yes/No parameter - is it possible?

Redrunner92
Collaborator
Collaborator

I have four Yes/No parameters, each associated with one Type parameter of a nested family. The main family's Yes/No parameters control the visibility of some parts of the nested family. Is there a way to type a formula into a Yes/No parameter to control it, based on a Text parameter? An example of what I want to do is below, though when I click "Enter" to set the formula, Revit gives me various errors depending on what I do. The most common error is "... ___ is not a valid parameter": this happens when I type "yes" and "no" as well as "true" and "false" for the two results in the If formula.

Redrunner92_0-1638216568597.png

 

0 Likes
Accepted solutions (2)
6,195 Views
5 Replies
Replies (5)
Message 2 of 6

Redrunner92
Collaborator
Collaborator
Accepted solution

From what I have found, Text parameters are not allowed to be used as the control in If functions. As such I have used an Integer parameter with a tool tip. Not the best way to go, but it does the job in a pinch.

Redrunner92_0-1638217613547.png

Message 3 of 6

ToanDN
Consultant
Consultant

@Redrunner92 wrote:

From what I have found, Text parameters are not allowed to be used as the control in If functions. As such I have used an Integer parameter with a tool tip. Not the best way to go, but it does the job in a pinch.

Redrunner92_0-1638217613547.png


Simplify your formula:

Project North - Down                  = Project North direction = 2

and so on.

There is no need for 1<2, 2<1, etc... noises.

Message 4 of 6

Redrunner92
Collaborator
Collaborator

Makes sense. By suggesting I continue to use the Integer parameter, are you agreeing that Text parameters cannot be used to drive the Yes/No parameters?

0 Likes
Message 5 of 6

ToanDN
Consultant
Consultant
Accepted solution

@Redrunner92 wrote:

Makes sense. By suggesting I continue to use the Integer parameter, are you agreeing that Text parameters cannot be used to drive the Yes/No parameters?


Correct.

0 Likes
Message 6 of 6

MichaelTierney739
Participant
Participant

I was just dealing with a similar situation and was able to make my if( statement work by creating a new yes/no parameter that was just set to yes, and then I referred to that parameter to have something to put in the part if the statement was true, and then I used a not() formula and used the same parameter for if the statement was false.

 

I needed to count how many yes/no parameters were marked yes, and if it was more than 1 I wanted this parameter to return yes, and no if not. 

 

Hope this helps even if it is 3 years late.