Parameter String Value Controls Yes/No Visibility Parameter

Parameter String Value Controls Yes/No Visibility Parameter

DavidHarrington-WPM
Contributor Contributor
3,376 Views
15 Replies
Message 1 of 16

Parameter String Value Controls Yes/No Visibility Parameter

DavidHarrington-WPM
Contributor
Contributor

I'm at my wits end on this one. Here's a run down of what I'm trying to do.

 

Type Parameters:

MyTextString - Text Parameters

HideTheDetailLine - Yes/No Parameter

 

When MyTextString has a value other than "". then enable the Yes/No parameter HideTheDetailLine.

 

I've tried to figure it out using this formula for the HideTheDetailLine parameters.

 

if(MyTextString),1=1,1=0)

 

But that isn't working...I get "Comma not expected" error.

 

Anyone know the vernacular here?

0 Likes
3,377 Views
15 Replies
Replies (15)
Message 2 of 16

ToanDN
Consultant
Consultant

Text parameters cannot be used to drive formula. Use another parameter type such as Yes/No, Number, Integer, etc to drive your formula.

For example: Use an integer parameter [Int] to drive a Yes/No parameter.

if (Int = 1, 1=1, 1=0)

https://revitforum.org/showthread.php/1046-Revit-Formulas-for-quot-everyday-quot-usage

0 Likes
Message 3 of 16

DavidHarrington-WPM
Contributor
Contributor

Not sure I understand. Do you mean create additional parameters that not text based to then control the other 2 parameters display?

0 Likes
Message 4 of 16

ToanDN
Consultant
Consultant
Please read my reply again.
0 Likes
Message 5 of 16

DavidHarrington-WPM
Contributor
Contributor

Hi again,

 

I've read your reply. Perhaps my problem may not have a solution, but that is what I'm wanting to do. If a parameter has a value greater than nil, then I would like a formula to understand that and impact a Yes/No parameter so that I can control the display of something else for when the text value is blank or filled.

0 Likes
Message 6 of 16

ToanDN
Consultant
Consultant
The solution is NOT using a text parameter, but another type such as a number parameter.
0 Likes
Message 7 of 16

DavidHarrington-WPM
Contributor
Contributor

Can you point me to how I can use the string value from my text parameter to control the display of other elements?

0 Likes
Message 8 of 16

barthbradley
Consultant
Consultant

https://revitforum.org/showthread.php/1046-Revit-Formulas-for-quot-everyday-quot-usage

 

NOTE: "Conditional statements can contain numeric values, numeric parameter names, and Yes/No parameters."

0 Likes
Message 9 of 16

DavidHarrington-WPM
Contributor
Contributor

That is an impressive forum thread and has what seems like a 100 different formulas. And that's just the first post...

0 Likes
Message 10 of 16

ToanDN
Consultant
Consultant

@DavidHarrington-WPM wrote:

Can you point me to how I can use the string value from my text parameter to control the display of other elements?


No you cannot use a text parameter to control the display of other elements. Use another type of parameter instated, as siad in the previous posts.

0 Likes
Message 11 of 16

ToanDN
Consultant
Consultant

@DavidHarrington-WPM wrote:

That is an impressive forum thread and has what seems like a 100 different formulas. And that's just the first post...


Think it is the same link in my 1st reply.

0 Likes
Message 12 of 16

barthbradley
Consultant
Consultant

@DavidHarrington-WPM wrote:

That is an impressive forum thread 


 

Agreed. And an excellent resource to keep handy.  Bookmark it or print it.  

0 Likes
Message 13 of 16

martijn_pater
Advisor
Advisor

Not possible to test for text condition in a formula as mentioned, so you will need three (or four) parameters something along the lines of:

parameter text input [textinput]
parameter text output : IF( [textinputhasavalue] , [textinput] , "")
parameter yes/no [textinputhasavalue]
(parameter yes/no) [hidemyline] : NOT( [textinputhasavalue] )

or

parameter text input [textinput]
parameter text output : IF( NOT([textinputhasavalue]) , "" , [textinput])
parameter yes/no [textinputhasavalue] (associate to line visibility directly ie.)

 

edit: may have read your question wrong since you want to enable the visibilitytoggle, but basically the answer is the same... to do it the other way around.

Message 14 of 16

DavidHarrington-WPM
Contributor
Contributor

Thanks Martijn, that is helpful.

 

So if I'm understanding the situation - I can manually "flip the switch" on the toggle which in effect can "" a secondary text parameter and control the display of elements via that toggle.

 

But I'm still stuck in that the value (or lack thereof) isn't driving the visibility. Rather it is being controlled by my fingers as I flip that switch. Am I correct here?

0 Likes
Message 15 of 16

martijn_pater
Advisor
Advisor

@DavidHarrington-WPM wrote:

But I'm still stuck in that the value (or lack thereof) isn't driving the visibility. Rather it is being controlled by my fingers as I flip that switch. Am I correct here?


Correct, see also edited post. Note that with the above you could still leave the input field empty whilst toggling it on anyway... so then it kind of defeats the purpose, but it might be the best approach anyway...

 

BTW what kind of text input are we talking about? Is it a finite number of options or random text? 

Message 16 of 16

DavidHarrington-WPM
Contributor
Contributor

Basically unknown text value. The value is shown via a nested symbol in my family. Then there is the detail line in my family. The 2 are related. When the value in my parameter is not nil, it'll show in the nested symbol. However, when the value is my parameter is nil, I get a "?" showing in the nested symbol. So I have to turn that off AND I have to turn off the detail line that is associated with it. Using a bank of toggles for each text/line that is part of my family isn't ideal - but if that is my only option then so be it.

0 Likes