# Allow rotations but lock lateral movements of objects

I have several thousand objects placed on a sphere which I want to move around the center of the sphere. It is critical that they don’t move laterally. Is there a property that can be set to lock x, y, z lateral movements and only allow rotations of the objects?

gumball?

Thank you Riccardo and Ben for your replies.

I was trying to keep the explanation to a minimum, but here is the full thing.
I have created a globe upon which I have wrapped many land masses. I want to demonstrate movements consistent with the curvature of the globe and the individual sections, hence no lateral movement. The way that I first approached this was to attach the top surface of each mass to the inside of spheres of identical radii which are transparent. This keeps the center of rotation of each of the objects at the same location. Then I used rotational axes to position the objects along the surface.

Riccardo asked that I attach some images and as I was preparing them I realized that I could relocate the gumball for each object to the 0,0,0 center point. This seems to work well without all of the additional spheres, if the gumball stays put! However, when I select multiple object, the Gumball doesn’t stay at 0,0,0 so I will have to rotate each one separately. I can live with that… I think.

Now it seems that I need to find a Python script that I can run to relocate the gumball on 2000 objects at once! Perhaps Helvetosaur may have a Python solution? He had an eloquent fix for another task I had to do.

I can imagine a solution using kangarro , grasshopper.
You would drag continents while all of them share a rigid point in the center…

You can also “cheat” by grouping your continents with a couple of squares (forming a big cube), so you have the gumball always located at the center…

I think you could make a relocate gumball macro with your center point, like this:
GumballRelocate 0,0,0 enter

You could make that a keyboard shortcut. Then you’d just need to tap that key after selecting your objects.

Problem is, that macro does not work with multiple objects selected, so you have to do it one object at a time.

I supplied a script to automate this in another thread.

Seems work here with 5 rectangular solids. I must be missing something…

Rotations.gh (208.3 KB)

Or me… what am I doing differently?

https://www.screencast.com/t/tfL5PShZ9

What you are showing is what I see, too. I’m not trying to solve their problem of wanting to pre-assign gumball location to each individual part (I’d think that’s easy to script but I’m not up for it today) - I’m intending to point out that they can still move multiple parts instead of having to ‘rotate each part separately’ by running a relocate macro on multiple pre-selected parts.

OK, I interpreted his request as relocating all selected objects’ gumball centers to the same location - which the script posted here does…

Thank you, Helvetasaur. Your interpretation is correct and the script that you created works perfectly! Thank you to everyone else who responded to my request. I am thankful for so many willing to share.

Helvetasaur’s script gives me the individual control of each object that I was looking for. However, I also find that I would like to rotate some of the objects as a group. When I group them together, the Gumball changes again to the group center and moves away from the 0,0,0 center.

I am sure that I am making this project more difficult than it needs to be as I am not very skilled in Rhino. I am sure that there are simpler and more elegant ways to accomplish my goals. I am sure that I will run into more problems, but I am slowly finding my way!

When you want a group of objects to rotate around your center point, select all objects you want to move together and run GumballRelocate and pick your center point.