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
Darren
Proven Zealot
Proven Zealot
on

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

-D

RoboticsME
Member
Member
on

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

LabVIEW.Legend
Member
Member
on

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

Samuel_James
Member
Member
on

what is the shortcut key to call this function?

Darren
Proven Zealot
Proven Zealot
on

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.

Alex5
NI Employee (retired)
on

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 (retired)
on

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).

KvZ
Active Participant
Active Participant
on

This is great! Thanks for sharing

Alex5
NI Employee (retired)
on

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)

comrade
Active Participant
Active Participant
on

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

comrade
Active Participant
Active Participant
on

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 (retired)
on

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.

Darren
Proven Zealot
Proven Zealot
on

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?

comrade
Active Participant
Active Participant
on

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
Active Participant
on

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

Active Participant
Active Participant
on

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

ColeV
Member
Member
on

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 (retired)
on

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)

ekenyon
Member
Member
on

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 (retired)
on

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.

ekenyon
Member
Member
on

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
Active Participant
on

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 (retired)
on

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.

Darren
Proven Zealot
Proven Zealot
on

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.

Alex5
NI Employee (retired)
on

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
Active Participant
on

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!)

Hooovahh
Proven Zealot Proven Zealot
Proven Zealot
on

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.

Active Participant
Active Participant
on

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

Hooovahh
Proven Zealot Proven Zealot
Proven Zealot
on

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

Craig_
Active Participant
Active Participant
on

New version 🙂

 

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

Craig H. | CLA CTA CLED | Applications Engineer | NI Employee 2012-2023
Contributors