LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Deselect Scripting

Solved!
Go to solution

Is there a way to deselect objects from a selection using scriptin?  I have a VI and I want to remove all code that isn't controls, cleaning the block diagram.  I thought I could perform a Select all on the block diagram, deselect the control terminals, then invoke a delete, but I don't see a way to deselect objects.  Is this a gap in scripting where it should be implemented?  Or did I miss it?

0 Kudos
Message 1 of 5
(2,998 Views)
Solution
Accepted by topic author Hooovahh

The only way I see to do this would be to get the selection list, index through the list to remove the controls, then make a new selection out of the remaining elements.

 

My understanding is that a selection is just an array of BD objects so I'm not sure what a deselect would really be besides removing it from the array.

Matt J | National Instruments | CLA
Message 2 of 5
(2,962 Views)

Yup while working through it this was the only solution I came up with that worked.  Get All Objects from the BD, the perform an Equal on the control terminal references, and if they are the same remove that reference from the array of All Objects (or conditional indexing) then use that selection.  Still I figured there would be a deselect but this works just fine.

Message 3 of 5
(2,925 Views)

Wiring False to the Selected property doesn't count?

Message 4 of 5
(2,916 Views)

@Darin.K wrote:

Wiring False to the Selected property doesn't count?


Oh it does, didn't think of that either.

0 Kudos
Message 5 of 5
(2,910 Views)