02-18-2020 05:15 AM
If I get a reference to a class specifier constant on the block diagram, and use the scripting property AllTypes[], in addition to the types shown when you click on the constant to select the type, are some private classes (eg CopyItem, CopyOperation). If I want to present a list similar to what is actually selectable, I would need to remove those private classes. Is there a way I can do that programatically?
Solved! Go to Solution.
02-18-2020 06:23 AM - edited 02-18-2020 06:25 AM
Sure, there is a way. There always is a way. There's no red carpet though.
You can get the private or scripting property, but you need a property node.
You'll need a DUT vi with a property node. Set it's class to the class of the ClassSpecifierConstant. Then set it's item to the item of interest. Then, read the Flags.IsPrivate or Flags.IsScripting property. These are brown nodes, so you need secret scripting stuff enabled.
EDIT: I'd advice to do this once, for all classes. Store the info in a map (FGV or even a constant), and every time you need it, you can get it fast. Details depend on your needs.
02-18-2020 01:01 PM - edited 02-18-2020 01:22 PM
Thank you! I just found these private properties related to the properties on a property node, and then read your message. For the record, private properties are documented on the LabVIEW wiki, eg:
https://labviewwiki.org/wiki/PropertyItem_class
I agree reading these property properties once for all properties and caching the results is a good idea, as it can take a second or so to process all the properties available for a given class.
For classes, this is essential, because the only way I know if a class is private is to see if *all* of its properties are private, and this takes some time to figure out:
Incidentally, I found at first that I could not programatically set a property node to a private property, even though with the ini key set the private properties show up in the right-click dialog for the property node. Luckily I don't need to do this. But then I discovered that there is a private method called SetProperties_AllowPrivate. Ah ha!
At the end of the day, I think it's going to be faster to simply maintain a list of not-private top-level classes in an array constant and filter based on those.
02-18-2020 04:02 PM - edited 02-18-2020 04:03 PM
I’m glad the LabVIEW Wiki was useful.
I have also created some VIs that can help do some of the VI Server stuff Wiebe suggested. Located on GitLab, here .
Chief LabVIEW Architect, Testeract | Owner, Q Software Innovations, LLC (QSI)
Director, GCentral | Admin, LabVIEW Wiki | Creator, The QControl Toolkit
Certified LabVIEW Architect | LabVIEW Champion | NI Alliance Partner