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

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.



Message 2 of 6

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

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.



Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 4 of 6

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 "". It doesn't do anything, but it triggers the DUT vi to be reactivated.

0 Kudos
Message 5 of 6

This works partially for me. For complete discussion see:

Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 6 of 6