Jump to content

Programmatically Set a Property Item


Recommended Posts

I want to set a property item in a Property node.  For properties that have a single ID, I can get this method to work:pii.png.b188c9093fea8671624201b3b36d510a.png

For example, setting a property item for a Control property node to "Label" simply requires the ID string "6332005"; yielding:pl.png.5e1023bdabed67525407876ebb0c3734.png

However many properties require more that one ID.  For instance:plt.png.5fd840fd4219e8982aa32bcff07e8f2b.png requires "6332005" (Label), and "632d800" (text).

I can't find a way to set a property item to a property that has such multiple levels.

Does anyone know how to do this?

 

Paul Cardinale

Link to comment

Someone from NI can chime in, but I think this is not possible and is one of those limitations of LabVIEW Scripting.  QuickDrop has a CTRL+Shift+B that operates on a property node and it has a limitation of not working with "dotted properties".  I assume that's due to a limitation with LabVIEW's scripting otherwise NI would have supported it.

Link to comment
  • 5 weeks later...

Thanks for digging this up, Paul. I got it to work for dotted properties of multiple levels (so not only Label.Text, but also things like Terminal.Wire.Terms[]). I'm going to try to update the VI Server Rename plugin for Quick Drop to allow setting dotted properties by using this deprecated property. (?)

  • Like 1
Link to comment
On 1/14/2019 at 8:45 AM, hooovahh said:

So does that mean that this deprecated function is still semi-supported?  I assume it was deprecated for a reason, is it unstable under any known circumstance?

If I recall correctly, it was deprecated because the current property is more explicit about how you're assigning the property name (ID, short name, long name), whereas the deprecated property was more ambiguous (you could wire in any of them I think). But to my knowledge, there's no problem using the deprecated property. When I update the VI Server Rename plugin, I'll make sure to only call the deprecated property if there's a period in the specified property name.

Link to comment
  • 2 weeks later...
  • 4 weeks later...
  • 9 months later...

Darren, any chance of getting the All Supported Properties property of the Property class (i.e. the property node) to actually return all the supported properties for the current class of the property node, including all of the nested ones?

As it is today, that property only returns the top level properties (so it would show a Label property if the node is linked to a class inheriting from Control, but not all the subproperties coming from the Label class).

If that's too hard for support reasons, maybe at least adding a new property which will actually return all of them?

Link to comment
6 hours ago, Yair said:

Darren, any chance of getting the All Supported Properties property of the Property class (i.e. the property node) to actually return all the supported properties for the current class of the property node, including all of the nested ones?

As it is today, that property only returns the top level properties (so it would show a Label property if the node is linked to a class inheriting from Control, but not all the subproperties coming from the Label class).

If that's too hard for support reasons, maybe at least adding a new property which will actually return all of them?

This is a good idea. I suggest posting it to the Idea Exchange.

Link to comment
  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.