LabVIEW APIs Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Quick Drop: Align front panel controls to connector pane pattern

Update [8-24-2011]: I modified the code where it should work now with non-standard connector panes.  Let me know if you have any problems.

Update [11-11-2013]: Add version 2

Default shorcut is now ctrl-A

Now aligns all controls and indicators based on the default grid size (12 pixels).

Also resizes the windows to fit.

Also turns off increment/decrement visibility on numerics (you can easily edit the top level vi to disable this behavior, my rational is that they are a rarely used feature that clashes with the clean look of alignment).

Update [10-28-2014] Add version 3

1. Now fixes the label position (turning off the increment/decrement sometimes leaves the label overhanging.

2. Now moves/resizes the front panel of gloabal VIs. (instead of erroring out)

Update [5-21-2015] Add version 4

1. Now size-to-fit the block diagram if it is in focus.

2. Added clear error for increment decrement not present on numeric system controls

Update [3-2-2016] Add version 5

1. Added clear error for increment decrement not present on enum and ring system controls

Update [4-11-2016] Add version 6

1. Now respects minimum front panel size property

Before:

before.png

After:

after.png

Install to your plugin directory if you're interested in trying it out.

Download History:

Align_to_connector_pane.zip (38.0 K)

193 Downloads

Align To Connector Pane 2.zip (88.4 K)

165 Downloads

Align To Connector Pane 3.zip (81.3 K)

94 Downloads

Align To Connector Pane 4.zip (100.9 K)

178 Downloads

Align To Connector Pane 5.zip (101.3 K)

39 Downloads

Comments
Example Gatekeeper
Example Gatekeeper

This shortcut is great!  But it only seems to work on 4x2x2x4 conpanes.  It barfs on 5x3x3x5 and higher.

-D

DNatt, LV R&D
Member RoboticsME
Member

Ah, good call.  I didn't try it on higher connector panes.  I'll see if I can get around to fixing that.

Member LabVIEW.Legend
Member

Can you make this vi for LabVIEW 2009. Thanks In Advance.....

Member Samuel_James Member
Member

what is the shortcut key to call this function?

Example Gatekeeper
Example Gatekeeper

It looks like it doesn't have a default shortcut assigned.  Click the "Shortcuts" button in the Quick Drop window and go to the "Ctrl-Key Shortcuts" tab to set the shortcut you want for this plugin.

DNatt, LV R&D
Alex5
NI Employee

Update [8-24-2011]: I modified the code where it should work now with non-standard connector panes.  Let me know if you have any problems.

Alex5
NI Employee

I did some major updating for my own use, and I thought I should share. I've uploaded it as the version 2.

Default shorcut is now ctrl-A

Now aligns all controls and indicators based on the default grid size (12 pixels).

Also resizes the windows to fit.

Also turns off increment/decrement visibility on numerics (you can easily edit the top level vi to disable this behavior, my rational is that they are a rarely used feature that clashes with the clean look of alignment).

Active Participant KvZ
Active Participant

This is great! Thanks for sharing

Alex5
NI Employee

Version 3 uploaded with a couple new fixes:

1. Now fixes the label position (turning off the increment/decrement sometimes leaves the label overhanging.

2. Now moves/resizes the front panel of gloabal VIs. (instead of erroring out)

Member comrade
Member

Love it! Especially not having to select all the FP elements

Member comrade
Member

Just realized that here also the labels of IMAQ image.ctl controls/indicators get erratically moved just somewhere. This seems to be connected with an already filed CAR here:

http://forums.ni.com/t5/LabVIEW/quot-Create-SubVI-quot-moves-labels-of-IMAQ-image-controls/m-p/29310...

Any chance of including the fix posted by Darren in the above Solution?

Alex5
NI Employee

Did you try running the shortcut twice? I move the label positions before I move the controls, because usually the label is anchored relative to the control position. If you run this shortcut a second time, it should adjust the label posision, but not move the control, because the control is already in the correct position.

Example Gatekeeper
Example Gatekeeper

comrade wrote:

Any chance of including the fix posted by Darren in the above Solution?


                   

I can post a subVI that will fix an IMAQ refnum label's position. What LabVIEW version do y'all want it in?

DNatt, LV R&D
Member comrade
Member

Using the shortcut twice in a row works perfectly. Good hint, never thought of something like that.

Darren - thanks for the offer, but until the offshooting labels are fixed via some version update using Alex's shortcut twice will do for me.

Active Participant David_Staab
Active Participant

This is the single most important LabVIEW Add-On ever created. You should be given the keys to the city NI.

Active Participant David_Staab
Active Participant

I just realized that you hide the increment/decrement buttons on numeric controls, too! *swoon*

Member ColeV
Member

There is a small bug when using digital controls from the "System" Pallette. In "Align To Connector.lvlib: Increment Decrement Visibility.vi" an error is thrown as the digital controls from the System pallette don't have increment/decrement toggles. This can be fixed by catching error 1054 after the reading the property and simply doing nothing. I can send the fix for a patch, but I've attached it below as well.

This is a great tool by the way. Thanks for making it.

Quick Drop Plugin bug.png

Alex5
NI Employee

A co-worker like the moving / resizing of the front panel so much, he encouraged me to do the same for the block diagram. So here it is, version 4. Enjoy! (note this doesn't do any cleanup, just size-to-fit)

(also I included ColeV's request for clearing errors during increment/decrement visibility)

Member ekenyon
Member

I love this quick drop plug in, any sub-vis that haven't been aligned using this make me cringe.

I have found that for vis that have rings or enums on the front panel/terminal, the Increment Decrement Visibility.vi throws an error. I have changed the first case structure to run "Enum" and "Ring" as nothing (see below) and it works fine. I'd recommend rolling that change into the next update if possible.

enum and ring.PNG

Alex5
NI Employee

Ah, the system controls strike again. I applied the same fix as I did previously for numeric system controls, where it will attempt and clear the error, so it will still turn of their visibility when using the modern pallette enum or ring.

I just uploaded version 5 with the fix.

Member ekenyon
Member

Ah, yeah, they were all system enums or rings. I didn't look closely enough at the comments above Thanks for the quick fix!

Active Participant David_Staab
Active Participant

I just installed LV 2015 SP1, and I'm getting this error when I use the plugin on the front panel of any VI. It still works on the BD.

error.png

Alex5
NI Employee

That doesn't reproduce for me (LabVIEW 2015 sp1 with and without the f1 patch, on Win 10), and is a rather surprising error to be getting. Let me know if you can think of any other details that might help.

Example Gatekeeper
Example Gatekeeper

That error happens whenever you try to set invalid bounds on a panel. Like giving it a window size too small, giving it a right coordinate smaller than a left coordinate, giving it bounds less than the left/top of the current monitor set, etc.

DNatt, LV R&D
Alex5
NI Employee

It turns out, the property also errors when trying to set the front panel bounds smaller than those set in the Front Panel Window:Minimum Size property.

I uploaded version 6 to now respect the minimum size property.

Active Participant David_Staab
Active Participant

Note to users: The tool won't work for multi-pane VIs or VIs with subpanels that enforce minimum bounds. (Not that it should; it's for non-UI VIs!)

Proven Zealot Proven Zealot
Proven Zealot

Yeah I guess the only recommendation I'd make is if the tool detects more than one pane on a panel, then do nothing.  But I agree, I've never used this tool on a VI like that, or on a VI with a minimum pane, or panel size, since as you mentioned this is for non-UI VIs.


Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
Interesting in learning all you can about automotive CAN bus communication? Checkout my 12 part CAN Blog series.

Active Participant David_Staab
Active Participant

I pulled in some open-source code where the dev saw it fit to enforce Min Pane Size on all his API VIs.

Proven Zealot Proven Zealot
Proven Zealot

Thank you, I just found a new feature to add to my Clean-up VIs function.


Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
Interesting in learning all you can about automotive CAN bus communication? Checkout my 12 part CAN Blog series.

Active Participant Craig_
Active Participant

New version Smiley Happy

 

https://forums.ni.com/t5/Quick-Drop-Enthusiasts/Quick-Drop-Keyboard-Shortcut-Arrange-VI-Window/gpm-p...

Craig H. | CLA CTA CLED | Systems Engineer | National Instruments
Contributors