[Feature request] Radiobuttons in spreadsheets

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
Posts: 63
Joined: Sat Aug 21, 2021 9:10 pm
Location: Malvern, PA

[Feature request] Radiobuttons in spreadsheets

Post by esr »

I'm designing a drilling jig to support vintage Model M keyboards that may need to be scaled to two different sizes - one for an M101 and another for an M122. It is fully parametrized, but at the moment one needs to poke in the base dimensions by hand, which is error-prone.

Excel and other spreadsheets have a radiobutton feature that allows selection among exclusive alternatives to set the value of a cell. If I had something like that, I could at least in principle set up my parameter spreadsheet to have an M101 vs. M122 radiobutton group. This feature would of course be very useful whenever it is required to set up one of multiple discrete variants of a parametrized part.

I do *not* suggest emulating Excel's UI for radiobuttons as that interface seems to me to be baroque and overcomplicated. Instead I think the ideal way to design this would be to give spreadsheet cells a radiobutton property that is string-valued. A cell with this property displays a radiobutton graphic instead of its content and becomes part of the radiobutton group named by the property. The state of a radiobutton's indicator is on (filled) if the cell value is nonzero, off if it is zero.

Whenever a radiobutton cell is clicked, two things happen: (1) all other radiobutton cells in the group are set to 0 and, (2) this cell's content is set to 1. Initially, if not all cells in a radiobutton group are zero, the one with the highest value is visually set "on" and all others "off".

Of course other cells in the spreadsheet would use these values in expressions - notably in conditionals.
Posts: 810
Joined: Thu Apr 05, 2018 5:15 pm

Re: [Feature request] Radiobuttons in spreadsheets

Post by adrianinsaval »

see this pending PR: https://forum.freecadweb.org/viewtopic.php?f=17&t=42183
not the GUI you have in mind but it gives you the same functionality (swithcing between diferent sets of variables)
Posts: 6785
Joined: Fri Nov 09, 2018 5:38 pm

Re: [Feature request] Radiobuttons in spreadsheets

Post by openBrain »

Maybe some inspiration with pure expression : https://forum.freecadweb.org/viewtopic.php?f=8&t=58657 (talking about the application example, not the topic by itself).
Post Reply