Quick Drop Enthusiasts

cancel
Showing results for 
Search instead for 
Did you mean: 

Quick Drop Keyboard Shortcut - Clear Array

Sometimes the "Make Current Values Default" causes a lot of unecessary data to be stored on the front panel. This shortcut makes it easier to empty arrays, saving lots of tedious clicking and context menu searching.

  1. Select the arrays you want to clear
  2. Open quick-drop (ctrl-space)
  3. Ctrl-C (by default)

Alternatively, you can hold down shift, and all front panel arrays will be cleared. There is also the option to select array constants on the block diagram for clearing (but no clear all on the block diagram.... that's dangerous)

The shortuct is saved in LabVIEW 2011.

Message 1 of 9
(11,005 Views)

Great function, but it only works on 1D arrays.  Is there going to be an update to handle multi-dimension arrays?

0 Kudos
Message 2 of 9
(7,189 Views)

I updated the shortcut to work for arrays of multiple dimensions.

0 Kudos
Message 3 of 9
(7,189 Views)

Ah, beat me to the punch. Fortunately you implemented the exact same way I was going to.

Thanks

0 Kudos
Message 4 of 9
(7,189 Views)

Alex5 wrote:


                       

Fortunately you implemented the exact same way I was going to.

Yeah, I tried to come up with a more generic clever way to generate the arrays of empty (default) values, but ended up going with the simple brute force approach.

0 Kudos
Message 5 of 9
(7,189 Views)

I didn't check it on the shortcut, but this code seems to return the default value for the data type and I would say you can't get much more generic:

DefaultVal.png

Of course, you have to clear or ignore the error.


___________________
Try to take over the world!
0 Kudos
Message 6 of 9
(7,189 Views)

Actually, I should probably have checked it before posting. It looks like it just returns an empty variant. Here's something that does work:

Default.png

I'm not 100% sure that dimensions of size 0 are the same as empty in this context, but I'm assuming it is. Maybe someone can check that.


___________________
Try to take over the world!
0 Kudos
Message 7 of 9
(7,189 Views)

Nice one, Yair. This is the approach I thought about taking, but then I was worried about using a non-default value from the original array. But then this morning (before I saw your post), I remembered that the VariantDataType VIs wipe out value information as they parse and set type info in the variant, so the approach would work after all.

Re: the Size value, I'm pretty sure that if the Type enum for a given Array Length is "Variable", then the Size value is ignored. The Size value only applies if you're setting an Array Length to be "Fixed" or "Bounded".

arr.png

0 Kudos
Message 8 of 9
(7,189 Views)

Now works by traversing the selected obect for all arrays, so you can select a cluster of arrays for instance, and it will clear all the arrays inside.

0 Kudos
Message 9 of 9
(7,189 Views)