hugo_fr Posted June 9, 2010 Report Share Posted June 9, 2010 Hi all, I wish for this VI : The ClassName property is easy, but how retrieving the class inheritance hierarchy ? Any idea ? Hugues. Quote Link to comment
crelf Posted June 9, 2010 Report Share Posted June 9, 2010 Can you post what you've already done so we can use it as a starting point? Quote Link to comment
Yair Posted June 9, 2010 Report Share Posted June 9, 2010 One thing you can try to do to automate this is Open the LV help. Go to the property and method reference. Right click it and choose to print all of it. This will open a window with all the properties and methods as a long HTML page. You can right click this window to get the source of the HTML, which you can now save or you can print it to PDF or to Office. Now you can parse it. For each class, you get the inheritance list at the start. You can use this info to build a static tree, which you can then use to extract the data. Not particularly elegant, but it should probably work. Quote Link to comment
Jon Kokott Posted June 9, 2010 Report Share Posted June 9, 2010 I have a VI that will give you a generic's hierarchy. I can upload it after work. ~Jon Quote Link to comment
Jon Kokott Posted June 9, 2010 Report Share Posted June 9, 2010 I did this VI more as an experiment in vi scripting than to be "good." I would recommend creating a static hierarchy and simply returning the section of interest as yair suggested above if you need this to be blisteringly fast. ~Jon Generic_VI_Server_Hierarchy.vi Quote Link to comment
Ton Plomp Posted June 10, 2010 Report Share Posted June 10, 2010 (edited) I did this VI more as an experiment in vi scripting than to be "good." I would recommend creating a static hierarchy and simply returning the section of interest as yair suggested above if you need this to be blisteringly fast. ~Jon Hi Jon, unfortunately your code does not work: It works if the input is not a constant but a true ref. Ton Edited June 10, 2010 by Ton Plomp Quote Link to comment
Yair Posted June 10, 2010 Report Share Posted June 10, 2010 The basic problem with both methods is that they're inherently manual. Mine has some advantage in that once you have the parsing code, adding a bunch of new classes is probably easier, but it's limited to what appears in the help. Jon's method is limited to the classes placed there by the user, but isn't limited to what NI placed in the help. I don't know of any way of getting all the class references automatically, but maybe someone else does. Quote Link to comment
hugo_fr Posted June 10, 2010 Author Report Share Posted June 10, 2010 Thanks for help. I did this code, quickly, manually, but work at this time and can evolve later. Class_Hierarchy_0.0.1.zip Quote Link to comment
hugo_fr Posted June 10, 2010 Author Report Share Posted June 10, 2010 The topic Saving all properties for Gobject contains a similar solution in the NI PropSaver library : PropSaver.llb\PropSaver - Predefined Property List.vi Hugues Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.