Stop rotating when in interference

I have a part mounted on a shaft. I know how to rotate the part on the shaft. The problem is at some point in the rotation the part will interfere with other parts of the component.

How do I get the Rotate command to stop when the selected area is in interference with the unselected part of the component ?

There’s no collision detection in SketchUp but you could use inferencing for this. When you are starting the rotation, click on the point of the rotating part that will collide with the non-moving part and rotate it until it hits the other part.