"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!
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

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

Post by TheMarkster »

Here is a link to the source code where this exception is thrown. It might save the developer some time in locating the issue.

https://github.com/FreeCAD/FreeCAD/blob ... e.cpp#L548

Code: Select all

   /* Evaluate the expressions, and update properties */
    for (;it != evaluationOrder.end();++it) {

        // Get property to update
        Property * prop = it->getProperty();

        if (!prop)
            throw Base::RuntimeError("Path does not resolve to a property.");

        DocumentObject* parent = freecad_dynamic_cast<DocumentObject>(prop->getContainer());

        /* Make sure property belongs to the same container as this PropertyExpressionEngine */
        if (parent != docObj)
            throw Base::RuntimeError("Invalid property owner.");
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 »

paullee wrote: Fri Sep 24, 2021 4:35 pm
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.
Thanks for the interest!

Please don't get bogged down in the exact expression.

I was trying to post a simpler and trivial example.

I would like to set the Visibility property of the link Array to False when the number of objects is 0.

The number of objects is dynamic and based on an expression from a spreadsheet.

This issue can be observed in much simpler examples, without spreadsheets.

For example, try to bind the Visibility property to a property on the link Array object itself like the Count.

This could work for my use-case as I want Visibility to be False when Count is 0 (i.e. hide the array when there's zero objects).

I've created attached a .FCStd document with the issue recreated, as requested.
LinkArrayVisibilityIssue.FCStd
(6.69 KiB) Downloaded 33 times
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: Sat Sep 25, 2021 12:17 am I would like to set the Visibility property of the link Array to False when the number of objects is 0.

The number of objects is dynamic and based on an expression from a spreadsheet.

This issue can be observed in much simpler examples, without spreadsheets.

For example, try to bind the Visibility property to a property on the link Array object itself like the Count.
Interesting, note the Visibility of Array (Link or non-link) in Data tab is hidden (by design ?). Visibility is usually only in View tab only, now it is shown 'twice'.

Anyway, Right Click Data Tab - Show All expose all properties. Right Click this 'Visibility', deselect 'Hidden'.

Then, it seems both Link and non-Link Version works - Visibility reference to a cell in Spreadsheet checking if ElementCount is 0


(For this exercise, I just set both Arrays NumberX reference to same Spreadsheet ElementCount for demonstration purpose)

LinkArrayVisibilityIssue_ r.FCStd
(7.39 KiB) Downloaded 34 times
Screenshot from 2021-09-25 08-57-03.png
Screenshot from 2021-09-25 08-57-03.png (217.51 KiB) Viewed 1218 times
Screenshot from 2021-09-25 08-59-30.png
Screenshot from 2021-09-25 08-59-30.png (186.73 KiB) Viewed 1218 times
Screenshot from 2021-09-25 08-59-39.png
Screenshot from 2021-09-25 08-59-39.png (208.54 KiB) Viewed 1218 times
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 »

paullee wrote: Sat Sep 25, 2021 1:07 am Anyway, Right Click Data Tab - Show All expose all properties. Right Click this 'Visibility', deselect 'Hidden'.

Then, it seems both Link and non-Link Version works
I confirmed this works. Thank you for the workaround!

This is a bit odd. I seem to be able to set expressions to other Hidden properties (e.g. NumberCircles is hidden for an ortho array).

What makes Visibility special where you have to make it not hidden?

Can anyone confirm if this expected behavior?

Also, to note I need to set the Visibility property in the Data tab, not View tab.

I have unique requirements, in that this has to work in a command-line environment or server context.
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 »

I had other inconsistent behaviour about 'hidden' 'outout' 'readonly' properties, so i just random test it :)

Probably a bug of some kind - worth to mention in a bug report.
chrisb
Veteran
Posts: 53937
Joined: Tue Mar 17, 2015 9:14 am

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

Post by chrisb »

Roy_043 wrote: Fri Sep 24, 2021 8:24 am File?
Sorry, I'm feeling like being new to this forum :oops: . Added the file to the post above.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

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

Post by TheMarkster »

None of the View tab properties work with expressions. This is probably the reason for the extra Visibility hidden property in the data tab.
Post Reply