LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Script for removing comments in entire project

Solved!
Go to solution

Take care not to accidentally delete any copyright notices.

Message 11 of 16
(886 Views)

@Ben, thanks for the snippet on but that give me a Project Item refnum. The Traverse for GObjects.vi requires a VI Refnum.  Delete All Comments In Proj.png

0 Kudos
Message 12 of 16
(840 Views)

Just that code isn't going to work... if you have any folders in your project it will return a reference to that folder but none of the contents.

 

The easiest option would be to just go to whatever folder you have the project in and do a recursive file list.

VI references.png

 

If you are determined to use a project level however you will need to make a recursive VI that will sort through all of the folders.  If you do this you will obviously want to exclude everything under Dependencies so that it doesn't try to remove comments from things in vi.lib, etc. Here is an example program you can modify showing how to recursively get vis in your project.

0 Kudos
Message 13 of 16
(830 Views)

Thanks! I modified this slightly by changing the tunnel for the outer loop to Concatenating.  This way it gives me one array with all the free floating text comments from all the VIs. Is there a way to also parse/list the text in sub-diagram labels? If you (or anyone else) post another snippet it would tremendously helpful if you could post as LV 2015. 🙂

0 Kudos
Message 14 of 16
(810 Views)

I found the SubdiagramLabel Visible property for Structure. 

https://zone.ni.com/reference/en-XX/help/371361N-01/lvscript/structure_p/

However, when I set the visible to False it doesn't seem to hide the subdiagram labels. The StructNames array clearly indicates that it is finding the Loops, Case Structures etc. but when I open a VI that has a For loop in it the subdiagram label is still visible.  I even tried changing the Target Class input of the ToMoreSpecificClass function from Structure to something more specific like CaseStructure and still the subdiagram labels remain visible for Case Structures. When I step through the code, no error is generated after the SubDiagLbl Vis property node. Can anyone shed any light on why this property is not doing what it should do?List All Comments In Proj.png

0 Kudos
Message 15 of 16
(795 Views)

Hello,

 

I used your snippet and noticed that mine would work if the VI was open. When it was not, it did not work unless I explicitly saved the VI with Save.Instrument. I placed it between the two for loops (using one of the error wires to enforce data flow), and this seemed to work for me.

Madison T
0 Kudos
Message 16 of 16
(760 Views)