# Quick Rotate function?

**URL:** <https://discourse.mcneel.com/t/quick-rotate-function/85311>\
**Category:** Mac\
**Created:** [June 26, 2019, 10:09am UTC](https://discourse.mcneel.com/t/quick-rotate-function/85311 "2019-06-26T10:09:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![antoine](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/antoine/32/747721_2.png) [@antoine](https://discourse.mcneel.com/u/antoine)\
**Post date:** [June 26, 2019, 10:09am UTC](https://discourse.mcneel.com/t/quick-rotate-function/85311/1 "2019-06-26T10:09:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gijs](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/gijs/32/769882_2.png) [@Gijs](https://discourse.mcneel.com/u/Gijs)\
**Post date:** [June 26, 2019, 10:29am UTC](https://discourse.mcneel.com/t/quick-rotate-function/85311/2 "2019-06-26T10:29:47Z")

</div>

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()
```

---

<div class="post-metadata">

**Author:** ![antoine](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/antoine/32/747721_2.png) [@antoine](https://discourse.mcneel.com/u/antoine)\
**Post date:** [June 26, 2019, 10:56am UTC](https://discourse.mcneel.com/t/quick-rotate-function/85311/3 "2019-06-26T10:56:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Gijs](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/gijs/32/769882_2.png) [@Gijs](https://discourse.mcneel.com/u/Gijs)\
**Post date:** [June 26, 2019, 11:10am UTC](https://discourse.mcneel.com/t/quick-rotate-function/85311/4 "2019-06-26T11:10:27Z")

</div>

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:

 ![35](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/f/4/f42814d28df1b9657bfeac37296882842741aa13.png)

@dan how can we change icons?

---

<div class="post-metadata">

**Author:** ![antoine](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/antoine/32/747721_2.png) [@antoine](https://discourse.mcneel.com/u/antoine)\
**Post date:** [June 26, 2019, 1:10pm UTC](https://discourse.mcneel.com/t/quick-rotate-function/85311/5 "2019-06-26T13:10:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jeff\_hammond](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jeff_hammond/32/768846_2.png) [@jeff\_hammond](https://discourse.mcneel.com/u/jeff_hammond)\
**Post date:** [June 26, 2019, 1:13pm UTC](https://discourse.mcneel.com/t/quick-rotate-function/85311/6 "2019-06-26T13:13:56Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Gijs](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/gijs/32/769882_2.png) [@Gijs](https://discourse.mcneel.com/u/Gijs)\
**Post date:** [June 26, 2019, 1:41pm UTC](https://discourse.mcneel.com/t/quick-rotate-function/85311/7 "2019-06-26T13:41:24Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jeff\_hammond](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jeff_hammond/32/768846_2.png) [@jeff\_hammond](https://discourse.mcneel.com/u/jeff_hammond)\
**Post date:** [June 26, 2019, 2:11pm UTC](https://discourse.mcneel.com/t/quick-rotate-function/85311/8 "2019-06-26T14:11:49Z")

</div>

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:

 ![28%20AM](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/5/e/5e03e3e0a8db8f499b4de710989129d4b5d87fe6.png)

---

<div class="post-metadata">

**Author:** ![Gijs](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/gijs/32/769882_2.png) [@Gijs](https://discourse.mcneel.com/u/Gijs)\
**Post date:** [June 26, 2019, 2:16pm UTC](https://discourse.mcneel.com/t/quick-rotate-function/85311/9 "2019-06-26T14:16:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dan](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dan/32/481637_2.png) [@dan](https://discourse.mcneel.com/u/dan)\
**Post date:** [June 26, 2019, 6:39pm UTC](https://discourse.mcneel.com/t/quick-rotate-function/85311/10 "2019-06-26T18:39:28Z")

</div>

> 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](https://mcneel.myjetbrains.com/youtrack/issue/RH-53465) Tool palettes should be shareable_

I agree this would be nice.
