08-11-2015 11:59 AM
Hi folks,
I have a little project to try and harvest comments from the block diagram, perhaps using VI scripting. So for example, when I'm checking #ToDo comments, I can get a list of the VI's that the #tag appears in and collect the text. I think I have found the method to get to the comment, but I'm not sure how to actually retrieve the text inside the comment. Below is a picture of how to get to the comment in the block diagram (just using this VI as a little example)
Thanks for your help!
Rik
Solved! Go to Solution.
08-11-2015 12:00 PM - edited 08-11-2015 12:11 PM
Here is what you want. It should be noted that the current code only outputs the comment outside the case structure because you'll need to dive in to the structure(s) for anything inside it.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
08-11-2015 12:33 PM - edited 08-11-2015 12:35 PM
@James.M wrote:
Here is what you want. It should be noted that the current code only outputs the comment outside the case structure because you'll need to dive in to the structure(s) for anything inside it.
Yes this code will traverse all GObjects but I'm pretty sure there is a bookmark manager API that will return bookmark comments if that is all you are looking for.
EDIT: Okay there is a invoke node that returns bookmark info on a VI reference but the VI can't currently be running.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
08-11-2015 02:41 PM
As Hooovahh showed, using the Traverse for GObjects function will recursively find objects inside of structures. If you have a lot of SubVIs that you also want to search for comments, you can first find the paths to all VI dependencies then individually traverse each VI for comments using the Get VI Dependencies Invoke Method
http://zone.ni.com/reference/en-XX/help/371361L-01/lvprop/vi_get_vi_dependencies/
08-11-2015 02:57 PM
As ever lots of useful replies! Thanks for all of your help. I suggest that hoovah's answer is the best not only because it works on VI's that are already open but also it gets text inside subdiagrams. Also it probably has some error checking built in to check the cast to Text is good.