Quick Rotate function?

Hello, using frequently keyboard shortcuts, and many time manipulating 3D objects in orthogonal orientation, I would like to create a shortcut, using -Rotate command and always using a 90° angle…
But I am unable to define the centroid of the selected object as input, of center of rotation.
Is it possible, in a command line? Or need we to create a Python script? In these second cas, could we assign Python script to a keyboard shortcut?

Thank you for your advices

yes you could do this in python:

import rhinoscriptsyntax as rs

def rotateObjs():
    objs = rs.GetObjects("select object to rotate 90", preselect=True )
    if not objs:
        return
    bb = rs.BoundingBox(objs)

    cen = bb[0]+bb[6]
    cen/=2
    for obj in objs:
        rs.RotateObject(obj, cen, 90)
rotateObjs()
1 Like

Thank you Gijs for your very quick answer
I knew how to do it in Python (because i did the same on a PC), but could we actually on MAC use script python as command for a button?
My goal is keyboard shortcut to automatically turn selection 90° right… is it possible now?

yes it’s possible, but as far as I know it is a bit cumbersome to get this to work:

-make a copy of the default Tool palet set
-add toolbar (appears in modified palettes)
-add button
-assign:

-_RunPythonscript (

#your code

)

to the button
there you can also assign a shortcut:

@dan how can we change icons?

1 Like

Thank you very much @Gijs it works great
of course I hope we could soon change icon, or draw them directly with a small editor. :slight_smile:

drag&drop an icon/image file to that square next to Text/Menu Text/Tooltip…

(i haven’t done this in forever but that’s how it used to work… probably still the same)

1 Like

yes, was just going to write that I found this out. This is indeed working

@jeff_hammond do you know if it is possible to share toolbar layouts as well?

i don’t think that’s possible @Gijs… not in any user friendly/ UI based sort of way.

as far as i know, the shareable stuff from Preferences would be these:

hmm, that’s a pity. Hope this gets added to v6 then

as far as i know, the shareable stuff from Preferences would be these

I’m surprised this was not already on our list. (If it is, I couldn’t find it). Logged here:

RH-53465 Tool palettes should be shareable

I agree this would be nice.

1 Like