From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
tst

Make the All Supported Properties property return nested properties

Status: New

The Property class, which represents the property node, has a property called All Supported Properties which ideally would show all the properties supported by the class the property node is linked to.

 

The problem is that it doesn't. If you have nested properties which come from another class (for example, the properties for the caption which can be selected by opening the pull right menu, as seen in the top image), those properties aren't returned when you call the property, and instead you just get the property for the caption reference, as seen in the bottom image, where the ControlIndex property is shown immediately after the Caption property.

 

NestedProps.png

 

 

Instead, I want either this property or a new property to return all of the nested properties as well, just like you get in the UI.

This would be useful for setting properties using scripting and alternate UIs (like this one or this one, which can't work today, because they can't get the full list of properties).

 

 

 


___________________
Try to take over the world!
7 Comments
wiebe@CARYA
Knight of NI

There is a change of an endless loop of course.

 

For instance, "Label" has an "Owner". "Owner" should not be traversed, or we'll have an endless recursion. There might be less obvious recursion problems...

tst
Knight of NI Knight of NI
Knight of NI

To be clear, the property should return everything that's in the selection menu. In the case of Label.Owner, it has no more levels in the menu, so there's no reason to return anything beyond that level.

 

nested.png


___________________
Try to take over the world!
wiebe@CARYA
Knight of NI

@tst wrote:

In the case of Label.Owner, it has no more levels in the menu, so there's no reason to return anything beyond that level.


Yes, obviously. 😀🌴 (:facepalm:)

 

I wander though if this new property should replace the old one, or if both should exist? Or a Boolean input?

littlesphaeroid
Active Participant

It's not immediately obvious, but the Long Name Localized cluster element of each property has a colon-delimited list of the property hierarchy (eg, "Bounds:Area Width"), so you can count the colons to get each item's nest depth in a tree.

_____________
Creator of the BundleMagic plugin for LabVIEW!
tst
Knight of NI Knight of NI
Knight of NI

The problem with that is you need to have a property in the property node to be able to use that. While it would be possible (and ugly) to copy the node to a temporary VI and expand it there, it looks like the expansion doesn't set the nested properties in the node, so that still brings us back to the same point.


___________________
Try to take over the world!
littlesphaeroid
Active Participant

I looked at your example more, and I agree that some nested elements are not available. But some are (consider Data Entry Limits). The discrepancy seems more like a bug than a missing feature. Frustrating indeed!

_____________
Creator of the BundleMagic plugin for LabVIEW!
tst
Knight of NI Knight of NI
Knight of NI

Data Entry Limits, as well as others, are clusters. They are made up of subelements, but they are all fully owned by the object the property node is linked to (a numeric, in your example).

 

The items that don't appear in the list are those which are owned by subobjects, such as the label or caption. The Caption property itself appears in the list, as shown in the original screenshot, but that just returns the top level property, which is the reference to the subobject. It doesn't return all of the properties owned by the subobject itself.


___________________
Try to take over the world!