0003466: Control objects visibility via expressions and spreadsheets cells

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!
silopolis
Posts: 59
Joined: Thu Oct 20, 2016 10:06 pm

0003466: Control objects visibility via expressions and spreadsheets cells

Postby silopolis » Tue May 08, 2018 2:57 pm

Hi

This would be valuable in many cases as witnessed by users interest in the following threads:
* https://forum.freecadweb.org/viewtopic.php?f=3&t=18681
* https://forum.freecadweb.org/viewtopic.php?f=10&t=18065

EDIT: forgot link to issue https://freecadweb.org/tracker/view.php?id=3466

AFAIC, in a woodworker/cabinetmaker use case, this feature would make my base parametric parts, cabinets/furnitures, assemblies much more powerful:
* cabinets with/without shelves/separations,...
* panels with/without edge banding, face veneering

For BoM/cutlist generation, an "Enabled" boolean property (like proposed in second linked thread, even a "dumb" one) would be further empowering by allowing to manage visibility and "existence" independently.

In the meantime, I'll take all ideas to create "optional" parts

Bests
Last edited by silopolis on Wed May 09, 2018 7:49 am, edited 1 time in total.
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: 0003466: Control objects visibility via expressions and spreadsheets cells

Postby eivindkvedalen » Tue May 08, 2018 7:46 pm

silopolis wrote:
Tue May 08, 2018 2:57 pm
Hi

This would be valuable in many cases as witnessed by users interest in the following threads:
* https://forum.freecadweb.org/viewtopic.php?f=3&t=18681
* https://forum.freecadweb.org/viewtopic.php?f=10&t=18065

AFAIC, in a woodworker/cabinetmaker use case, this feature would make my base parametric parts, cabinets/furnitures, assemblies much more powerful:
* cabinets with/without shelves/separations,...
* panels with/without edge banding, face veneering

For BoM/cutlist generation, an "Enabled" boolean property (like proposed in second linked thread, even a "dumb" one) would be further empowering by allowing to manage visibility and "existence" independently.

In the meantime, I'll take all ideas to create "optional" parts

Bests
Visibility is selected by a property in the document object's gui part, and expressions are not supported for any of these properties (internally they only work for objects derived from the DocumentObject class). IIRC there was a technical reason for this, so this is not easy to implement, unless we move visibility into the DocumentClass class (which I think would be a good thing).

Eivind
silopolis
Posts: 59
Joined: Thu Oct 20, 2016 10:06 pm

Re: 0003466: Control objects visibility via expressions and spreadsheets cells

Postby silopolis » Wed May 09, 2018 7:55 am

Hello Eivind,
eivindkvedalen wrote:
Tue May 08, 2018 7:46 pm
[...]
Visibility is selected by a property in the document object's gui part, and expressions are not supported for any of these properties (internally they only work for objects derived from the DocumentObject class). IIRC there was a technical reason for this, so this is not easy to implement, unless we move visibility into the DocumentClass class (which I think would be a good thing).
Thank you for this under the hood explanation.

Seems like I don't have much chance with my FreeCAD wishes lately. Couldn't this be proxied, observed, messaged from one side of to the other ?

Have a nice day
chrisb
Posts: 25204
Joined: Tue Mar 17, 2015 9:14 am

Re: 0003466: Control objects visibility via expressions and spreadsheets cells

Postby chrisb » Wed May 09, 2018 8:39 am

Another possibility might be to call a hook after a chenge to a spreadsheet cell. I don't know if this raises security issues.