This is very helpful, thank you. It works very nicely for a single, pre-selected object. That object will retain the Gumball alignment until it is reset from the Gumball menu, even if de-selected and then re-selected.
I hoped to be able to apply it to multiple objects, but then it only sets the alignment for the group, and if un-selected the individual objects revert to their prior settings. I have to select them one at a time and set the Gumball on each with the macro.
I spent a while trying to figure a way to rewrite the macro and sub in CPlane _Object, so I could use a reference object instead of the view, but having to pre-select the object I wanted to apply the Gumball to prevents me from picking the reference object while inside the macro.