Rotate Tool Question

I’ve been trying to set up a macro to create an axon for me in one Alias, but I’ve seem to hit a wall. At the moment I have
“!_Rotate 0 -45 SetActiveViewport Right Shear w0,0 w0,0,1 -45 SetActiveViewport perspective”
The major flaw with it being that for that first rotate command to work, it uses the global origin, so the further the object is from the origin the greater the distance it travels. I know that using the gumball to rotate removes that problem, but there is no way to input a gumball move via the command line. Finding the center point of any object is made easy with AreaCentroid which gives the coordinates of the center as well as creating a point for those coordinates. My problem could be solved if one of these questions could be answered:
1: How do you input a gumball comand via the commandline
2: How do you set the origin of a new rotation to either the coordinates provided by the AreaCentroid tool, and/or the point created
If neither of those questions can be answered, what are my next steps toward solving this?

This is not really easily solvable with a macro… there’s no way I know of that you can get the AreaCentroid or Gumball center point coordinates to use to reset the CPlane origin inside a macro - which is what you need to do, as Rotate is always relative to the active CPlane. The Gumball uses the object’s bounding box center, but it’s the same thing.

This is what scripting is for… macros have their limits. With a script you can get and store the object’s “center” coordinates and recall them for further operations.

Here is a very laborious macro for setting a CPlane to the area centroid of an object…

AreaCentroid Pause SelLast SetObjectName "Pts"
Copy 0 1,0,0 0,1,0 Enter SelLast SetObjectName "Pts"
-SelName "Pts" PlaneThroughPt SelNone SelLast 
SetObjectName "Srf" CPlane Surface Enter Enter
-SelName "Pts" -SelName "Srf" Delete

You can continue from there…