08-31-2023 09:54 PM
I am working on some code to find project items with no callers and then operate on those items such as deleting them from the project. One of the things that I want to be able to do is double click an item and have that item activated (selected) in the project like is done when clicking View->This VI in Project (Cntrl+Shift+E). Does anyone know how to activate a project item programmatically?
Solved! Go to Solution.
09-01-2023 02:38 AM
There is no visible method for the project class to do that, only one where you can remove objects. But how to find those unused?
Even if you unhide the hidden methods with SuperSecretPrivateSpecialStuff=True, there is nothing like "get all VIs without caller" or similar.
09-01-2023 02:44 AM
Hi,
Class "Project Item" has a private method called "Select Item" that allows to select this item in the project.
Set input "Select" to true or false whether you want to select or unselect.
Set input "ClearPreviousSelection" to false if you want to keep previous selection (to allow multi-selection).
Add "SuperSecretPrivateSpecialStuff=True" to your LabVIEW.ini to be able to view all VI server private classes, methods and properties.
Regards,
Raphaël.
09-01-2023 03:16 AM
@cbfsystems wrote:
I am working on some code to find project items with no callers and then operate on those items such as deleting them from the project. One of the things that I want to be able to do is double click an item and have that item activated (selected) in the project like is done when clicking View->This VI in Project (Cntrl+Shift+E). Does anyone know how to activate a project item programmatically?
How does selecting the item in the project help with finding items without callers?
How about this:
09-01-2023 03:24 AM
@raphschru wrote:Add "SuperSecretPrivateSpecialStuff=True" to your LabVIEW.ini to be able to view all VI server private classes, methods and properties.
Or:
Select a new method (invoke) node.
CTRL+Space, type "ProjectItem", CTRL+B
Select the method (invoke) node.
CTRL+Space, type "SelectItem", CTRL+SHIFT+B
That should set the brown node, even without the secret ini file keys.
09-01-2023 05:02 PM
Thank you! That's what I'm looking for.
09-01-2023 05:03 PM
Thanks, that's a nice way around having to do the SuperSecretPrivateSpecial thing.