I’ve written a script to let users align their nodes using keyboard shortcuts.
I can get pretty OCD about making sure my Dynamo definitions are clear, minimising crossed wires and aligning nodes wherever appropriate - but I wish there was a simple keyboard shortcut to help align Dynamo nodes instead of having to constantly right-click, select align and so forth.
I used a piece of productivity software called AutoHotKey (which is free, open-source and under a GNU license) to automate this process using a short script (attached). Just right click, run with AHK and use the following commands to align your nodes:
Ctrl + Shift + Right :: Align Nodes Right
Ctrl + Shift + Left :: Align Nodes Left
Ctrl + Shift + Up :: Align Nodes to the Top
Ctrl + Shift + Down :: Align Nodes at the Bottom
Visit https://autohotkey.com to download AutoHotKey (3MB) for free. UPDATE: Some users are reporting the AHK website is down, please see below post for download mirrors
Install the software; please note there is no actual AutoHotKey program with a user-interface. If you open the program all you will see is a help file.
Run Instructions
All you need to do is right-click on the text file (downloaded from link above) and run with AHK. A green H icon will appear in the bottom-right of your taskbar and you’re good to go. Open Dynamo, press one of the shortcuts described above and start aligning those nodes!
To Run On Startup
With a little know-how, this script can be configured to run automatically on startup.
Sweet! I’ve been using way too much alt+e+a+t and alt+e+a+r. This will be a nice addition.
One quick question though - is it possible to make a Distribute X and Distribute Y as well or is this a no-go due to how Autodesk has coded that menu? (alt+e+a+x does nothing as best I can tell).
Sadly it does look like they’ve mapped the same accessibility keys twice (X and Y). I’m also having trouble using arrow keys to navigate the sub-menus… perhaps we put this one on hold for the time being
Looks like the team is planning to add more short cut, see this github wish:
Align Tools
– If More than one node is selected, then:
— Left Align: Selection + A
— Top Align: Selection + W
— Right Align: Selection + D
— Bottom Align: Selection + S