Command for centering a selection on an axis?

Is there a way to quickly grab multiple pieces and center the entire selection to an Axis?

I know align centers items on an axis but it centers every individual piece on the axis rather than the selection. My current workaround is grouping the selection together and then using align and then ungrouping after the command. Is there a way to do this in a single step rather than all 3? Thanks!

Hi Nicholas - a macro:

! Group Pause SelLAst SetGroupName "X" 
Align HorizCenter 0
-SelGroup "X" Ungroup


Thanks for the response Pascal! I’ll test it out. Sorry I’m pretty new! I was using Matrix for jewelry design on a PC all of these years and just switched to Mac so I’m going to straight Rhino without Matrix. There are a few commands in Matrix that I relied on that aren’t part of Rhino so I’m trying to figure out comparable workflows in Rhino. Here’s two more I haven’t figured out yet…

In Matrix F4 is a shortcut for center of the universe. So for example if I were to start the mirror command I could hit F4 and then it would select 0,0,0 as the mirror point. I know I can hit 0 ENTER but I’m trying to set 1 as a keyboard shortcut to function like F4 rather than hitting 0 and Enter.

Is there a way to start the move command from the selected objects center point? I’ve been creating a bounding box and then centering a point on the bounding box but would like to know if there is a single step solution or script for for that as well?

Really dumb question… Can you change the icon for a new command that you create?

Any help is greatly appreciated!

Normal Rhino objects do not have a “center” attached to their definition that one can normally snap to. It is certainly possible to Python script something - macro maybe also, but it would probably be a bit clumsy. There is one other possibility, and that is to use the Gumball pivot - which uses the bounding box center of the object if it is set to “world” or “cplane” and hasn’t been moved. You cannot access the Gumball pivot point with the command Move, but if you just select the object, you can snap-drag it from the gumball pivot to another snap point.

Edit - here is a sample python script (320 Bytes)

On Mac, you will need to create a new custom command set if you want to create/modify toolbar icons/commands.


I really appreciate your response. It looks like I need to become a little more familiar with scripting and I’ll be able to program the different commands I’m after. Thanks for taking the time to help.