Does anybody know how to get a list of the public properties for a class?
Preferably the tool looks like the app method 'Get Class Methods'
Solved! Go to Solution.
LVOOP classes only have private properties. To provide public access to a property, you have to write an accessor VI. There's no standard pattern for naming accessor VIs, so there's no generic tool for finding and enumerating them.
VI Server classes list all their public properties when you click on a property node that's configured for that class.
Or did you mean some other kind of class?
No you understand correctly I mean the properties that you (externally) access via property node. However I need the list programmatically for documentation function. I hope someone allready had made a tool that could retrieve the list.
Not seen anything specific but I would think, if it is for development purposes I would be tempted to take a look at the project API. As they are a special definition in the project I suspect there would be a way to pull it through this.
You should be able to open a reference to the LV class and then iterate through its project items looking for any that are of type PropertyFolder and then testing that their access scope is public.
Here's the working code:
In short I get all property folders, iterate over them, get all containing VI's, check if they match the correct connector pane, the location of indicators and controls.
The case structure should have the case 'Public .. Community'
PS AQ why is the enum of 'Scope' in this order:
Why bother checking the conpanes? If they're in a property folder, they either match the required conpane or the class is broken. If there are two VIs, then set both the read and the write. If there's only one, just check which of the two terminals is wired. Much much faster than the code you've written.
> AQ why is the enum of 'Scope' in this order:
Because protected scope was added after libraries were finished. Community scope was added three versions of LV after the others and enums can only be extended by adding to the end of an enum (otherwise you break existing code).
I do extensive checking because I thought that it was possible to have more than two VIs in a property definition folder. However checking in LV 2011 and 2012 prove me wrong. 2010 perhaps?