Yes/No instead of True/False

Can we make these guys display Yes/No?
Not as a permanent solution but have this embedded in a particular script.
It would be nice for them to change it’s dark grey background to standard green/red (think of traffic light).
image

Hi,

Check this old thread: Toggle with one click

Cheers,
BVR

Yep, I’m aware of it. I even have it installed.
It displays True/False.
image

1 Like

The point was them to display Yes/No on the ‘brick’ :slight_smile:

It’s kind of a naming convention from computer science. Not sure if David would make that customizable.

You can make your own VS project. Use a small Form and one CheckBox with appearance of a Button. Or you can try to use the Toggle from GH and change the text. Not realy worth if you don’t need a permanent solution.

If I only knew how to do this… I am not familiar with coding at all (one of my major desires in life).

https://www.grasshopper3d.com/forum/topics/c-toggle-and-then-input-parameter

As you can see its no magic behind, but even not trivial. You may need VisualStudio to make this.

Hi Piotr, Check this

YesNo.gha (11.5 KB)

5 Likes

Yes, yes, yes!
Thanks!
PS Can white dot become red-ish, please?

Yes :slight_smile:

image

YesNo.gha (11.5 KB)

3 Likes

Sweet.
I really appreciate it.

Great stuff!
But out of curiosity why is Yes/No better than True/False, or On/Off?
I guess it makes sense if they answers to questions of course.

It’s not for me but for the people from my company that are unfamiliar with Rhino/Grasshopper.
They use my scripts for making the sales offer, quantity survey, renders and more (we build bathroom, hotel and residential modular units).
I want to make the scripts more visually pleasant with an overview at a glance.

1 Like


We’ve found that sometimes true/false works better, and sometimes yes/no is preferable. In GH2 a fair number of boolean inputs have presets defined for “yes”=true and “no”=false, so both the preset picker object and the tooltip show “Yes” instead of “True”.

You can do this in GH1 a little bit by creating a ValueList object with those same presets.

1 Like

Hi Seghier,

I includeed *.gha to grasshopper’s Libraries, but can not find it in Grasshopper menu layout.
Could you attach any sample file with sample script?

It is in the same place with button and original toggle.

image

Thanks a lot!