"Invalid property owner" for Visibility Expression of Link Array

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
gbroques
Posts: 167
Joined: Thu Jan 23, 2020 3:28 am
Location: St. Louis, Missouri

"Invalid property owner" for Visibility Expression of Link Array

Post by gbroques »

Hi all.

I'm trying to bind an expression to the Visibility property of a link array created with the Draft workbench from a spreadsheet.

However, I see this error in the Report View:
17:44:57 <Exception> Invalid property owner.

Steps to Reproduce
  1. Create new document
  2. Create spreadsheet from Spreadheet workbench
  3. Add expression like =5 > 1 ? True : False with an alias of CubeArrayVisibility to newly created spreadsheet
  4. Create Cube from Part workbench
  5. Create Link Array (linear or ortho) from Draft workbench using Cube
  6. Select Link Array from Tree View
  7. Right click data tab in combo view, Select Show All.
  8. Right click Visibility property. Select Expression
  9. Bind the CubeArrayVisibility to the Visbility property of the Array
(Let me know if these steps are not clear enough)

Is this error expected?

Any help, or a workaround is appreciated. :)

"Invalid property owner" Error in FreeCAD Soure Code:
https://github.com/FreeCAD/FreeCAD/blob ... #L547-L549

Code: Select all

OS: Ubuntu 20.04.3 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24291 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.19.2)
Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
Python version: 3.8.8
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
Last edited by gbroques on Thu Sep 23, 2021 11:09 pm, edited 1 time in total.
User avatar
gbroques
Posts: 167
Joined: Thu Jan 23, 2020 3:28 am
Location: St. Louis, Missouri

Re: "Invalid property owner" for Visibility Expression of Link Array

Post by gbroques »

It seems like I see this error no matter what the Visibility property expression of the Link Array references.

For example, referencing itself (e.g. Count or .NumberX) or referencing some property of the underlying linked object (e.g. Cube.Length).

Essentially, what I want to do is toggle the Visibility to False when the Count is 0.

Since Link Arrays still show the object when the count is 0 (e.g. Number X, Y, and Z are 0 for an Ortho array still shows 1 object).

In my case, the number of objects in the the array is dynamic and based on an expression.
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: "Invalid property owner" for Visibility Expression of Link Array

Post by chrisb »

There is something strange with the Visibility property of a Link Array. I can use a formula similar to yours and it works to control the visibility of a non link array, but not for a link array.

OS: macOS 10.16
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 (Git)
Build type: Release
Branch: master
Hash: b2ca86d8d72b636011a73394bf9bcdedb3b109b7
Python version: 3.8.8
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
gbroques
Posts: 167
Joined: Thu Jan 23, 2020 3:28 am
Location: St. Louis, Missouri

Re: "Invalid property owner" for Visibility Expression of Link Array

Post by gbroques »

chrisb wrote: Thu Sep 23, 2021 11:39 pm There is something strange with the Visibility property of a Link Array. I can use a formula similar to yours and it works to control the visibility of a non link array, but not for a link array.
Thanks for this reply and confirmation Chris.

As a workaround, I can use a non-link array.

I don't have strict requirements where I have to use a link array.

Although, it would be nice for the memory and performance aspects.
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: "Invalid property owner" for Visibility Expression of Link Array

Post by chrisb »

gbroques wrote: Thu Sep 23, 2021 11:46 pm Although, it would be nice for the memory and performance aspects.
Please create a ticket in the bug tracker.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
gbroques
Posts: 167
Joined: Thu Jan 23, 2020 3:28 am
Location: St. Louis, Missouri

Re: "Invalid property owner" for Visibility Expression of Link Array

Post by gbroques »

chrisb wrote: Fri Sep 24, 2021 12:07 am
gbroques wrote: Thu Sep 23, 2021 11:46 pm Although, it would be nice for the memory and performance aspects.
Please create a ticket in the bug tracker.
I created a ticket in the bug tracker for this:
https://tracker.freecadweb.org/view.php?id=4750
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: "Invalid property owner" for Visibility Expression of Link Array

Post by chrisb »

gbroques wrote: Fri Sep 24, 2021 12:33 am I created a ticket in the bug tracker for this:
Thanks. Would you mind adding a simple file showing the issue?

Edit: I probably have mine on the other computer, so you can wait.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: "Invalid property owner" for Visibility Expression of Link Array

Post by chrisb »

Here is an example which should make things clear. Please check if it serves this purpose:

The file contains a normal Array with an expression setting the visibility depending on the number of occurrences. If NumberX is greater than 3 the array will be shown, if it is 3 or less it is hidden.
This works well (in the file you have to recompute manually due to the error in the Link array).

It contains further a LinkArray, which uses the same properties including the expression for the visibility.
It doesn't work here instead I get an error in report view
<Exception> Invalid property owner.
Attachments
LinkArrayVisibilityExpr.FCStd
(8.36 KiB) Downloaded 22 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: "Invalid property owner" for Visibility Expression of Link Array

Post by Roy_043 »

chrisb wrote: Fri Sep 24, 2021 7:34 am Here is an example
File?
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: "Invalid property owner" for Visibility Expression of Link Array

Post by paullee »

gbroques wrote: Thu Sep 23, 2021 10:56 pm
[*]Add expression like =5 > 1 ? True : False with an alias of CubeArrayVisibility to newly created spreadsheet
Hi, trying to understand how this works :)

Can you tell the exact expression used in the spreadsheet ? Or post the file for reference ?

Thanks.
Post Reply