PedjaS wrote: ↑Mon Sep 14, 2020 10:04 am
It was just I wanted to try with this visibility thing
You need to have a closer look. The visibility of the red and blue objects is changed via expressions. The HowTo is given here by @TheMarkster and also in the link in my first answer. It is only for the cylinder that a workaround is used.
Strange. Few minutes before, when I checked again, Expression was not in the menu. Now it is.
However, it still does not work properly because as soon as I do fusion, visibility property becomes ineffective. I have to use workaround with placement.
TheMarkster wrote: ↑Sun Sep 13, 2020 5:45 pm
Just making something invisible won't remove it from the model, but you can manage the visibility property via a spreadsheet. Suppose your object is named Cylinder and your spreadsheet is named Spreadsheet and the alias is named isVisible. In the python console enter:
Can also be done in the Gui with right clicking and choosing Show all, then right click on Visibility property, set Expression, set link to spreadsheet alias.
this trick works great. Just one question to it. How can I do it with link objects?
I have Cylinder1 => no problem setting the visibility expression
Cylinder001 is linked to Cylinder1 => setting the expression throws the error "<Exception> Invalid property owner."
When i try the autocomplete in python console Cylinder001 isn't even listed.
Using Freecad 0.19 and 0.20
Last edited by andi11 on Mon Nov 22, 2021 9:23 am, edited 1 time in total.
andi11 wrote: ↑Mon Nov 22, 2021 9:16 am
I have Cylinder1 => no problem setting the visibility expression
Cylinder001 is linked to Cylinder1 => setting the expression throws the error "<Exception> Invalid property owner."
When i try the autocomplete in python console Cylinder001 isn't even listed.
Using Freecad 0.19 and 0.20
'Cylinder001' is the label (user changeable) of a Link whose name (readonly) is actually something like 'Link001'. To reference an object by label, the expression syntax is <<Cylinder001>>.Visibility
I have a pending PR for enhanced expression auto complete, which will suggest the correct syntax.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
I don't think it's an issue of not getting the correct object from the label. When pressing Ctrl+Shift+P the "Link" name is used to set the variable obj. But still the invalid property owner error happens on recompute.
TheMarkster wrote: ↑Tue Nov 23, 2021 1:21 am
I don't think it's an issue of not getting the correct object from the label. When pressing Ctrl+Shift+P the "Link" name is used to set the variable obj. But still the invalid property owner error happens on recompute.
I see. An object can only bind expression to its own property, while Link does not own the 'Height' property. You can do this instead, which works for non-Link object as well, since all objects have 'getLinkedObject()' and will return itself if it is not a Link.