LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Make selection method doesn't show marching ant until objects clicked

I am writing a script that creates new objects on the block diagram. The script uses the Make Selection method, and although the objects are selected when the script ends, the marching ants showing that the objects are selected don't show up until one of the objects is clicked. Of course if you click somewhere else, the selection is lost.

 

The reason i want the objects to appear to be selected is so that the user can know to grab the newly created objects (as a group) and move them where they want them.

 

Is there some other method or property I need to invoke to get the selection to appear as a selection?

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 1 of 6
(1,902 Views)

In general, ants don't show when the window isn't active.

 

If you create a selection with scripting, the window might not be active.

 

If you call method Diagram.Open (with true wired to it, ignore the fact that it is already open) the diagram will activate, and for me the ants show.

 

You can do a quick test, by activating the window by clicking it's title bar. If the ants show, the window activation is the problem.

 

ants.PNG

Message 2 of 6
(1,881 Views)

I had high hopes for this excellent explanation, but unfortunately it did not solve my problem.

 

A bit more background:

 

I am running this script within a right-click LabVIEW plugin. When the script ends, the block diagram window is active (there is a dialog in the plugin, but when it is gone, the originally active window becomes active again). I applied the BD.Open = T property as you suggested, but this did not have the desired effect. 

 

I'll poke around a little more. 

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 3 of 6
(1,831 Views)

Here's some additional information.

 

If I use the method Move Selection To Front, I can consistently get non-marching ants (aka dotted line) on the selected objects when my script ends, but mousing over the selected objects causes the dotted line to disappear. Fun.

 

Encouraged, I tried Move Select To Back, and this worked. A hacky workaround.

 

Cheers!

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 4 of 6
(1,824 Views)

Where's a workaround that worked for me in a similar situation (a right-click menu plug-in).

 

Be warned: it's silly.

 

The plug in makes a selection. To be precise, when right-clicking an object in a cluster, you get a "select parent" menu. When you select it, the parent cluster of the object is selected. It's posted here.

 

The trick is to call a VI, that opens and closes it's front panel when called. It's called "Flash.vi". It doesn't do anything, but it triggers the DUT vi to be reactivated.

0 Kudos
Message 5 of 6
(1,772 Views)

This works partially for me. For complete discussion see:

 

https://forums.ni.com/t5/LabVIEW-Shortcut-Menu-Plug-Ins/Selected-Items-in-plugin-script-have-no-marc...

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 6 of 6
(1,759 Views)