LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Activate or select project item programmatically

Solved!
Go to solution

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?

0 Kudos
Message 1 of 7
(1,025 Views)

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.

0 Kudos
Message 2 of 7
(973 Views)
Solution
Accepted by cbfsystems

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).

 

raphschru_0-1693553953400.png

 

Add "SuperSecretPrivateSpecialStuff=True" to your LabVIEW.ini to be able to view all VI server private classes, methods and properties.

 

Regards,

Raphaël.

 

Message 3 of 7
(966 Views)

@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:

 

Items without callers.png

Message 4 of 7
(949 Views)

@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.

Message 5 of 7
(945 Views)

Thank you!  That's what I'm looking for.

0 Kudos
Message 6 of 7
(887 Views)

Thanks, that's a nice way around having to do the SuperSecretPrivateSpecial thing.

0 Kudos
Message 7 of 7
(885 Views)