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:
After:
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
Ah, good call. I didn't try it on higher connector panes. I'll see if I can get around to fixing that.
Can you make this vi for LabVIEW 2009. Thanks In Advance.....
what is the shortcut key to call this function?
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.
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.
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).
This is great! Thanks for sharing
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)
Love it! Especially not having to select all the FP elements
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:
Any chance of including the fix posted by Darren in the above Solution?
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.
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?
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.
This is the single most important LabVIEW Add-On ever created. You should be given the keys to the city NI.
I just realized that you hide the increment/decrement buttons on numeric controls, too! *swoon*
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.
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)
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.
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.
Ah, yeah, they were all system enums or rings. I didn't look closely enough at the comments above Thanks for the quick fix!
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.
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.
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.
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.
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!)
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
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
I pulled in some open-source code where the dev saw it fit to enforce Min Pane Size on all his API VIs.
Thank you, I just found a new feature to add to my Clean-up VIs function.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
New version 🙂