Macro to add Front, Top and Right Mate between 2 preselected components?

I haven't learned to write these yet...I was just thinking, a macro that adds front-to-front, top-to-top and right-to-right mates of two pre-selected components would be a handy dandy tool to have.  Anyone know if such a thing exists somewhere? 

SolidworksApi/macros
Answers 2
DL
DL 2021-04-08 Best Answer

Mating Origin to Origin (with Align Axes checked) would mean you only need one mate to achieve the same thing (and probably easier to program).  Might be worth searching for that approach.

JW
JW 2021-04-08

...huh...until I read this I just assumed origin to origin mates were like point to point mates; still allowing you to spin the mated component on the point.  Looks like that is not the case.  I just tried doing so and found that a single origin mate does in fact lock the component in place.  

I have been using SW for 15 years....took me a while to learn this one...yeesh! 
Thanks a heap though!!  Definitely an improvement from 3 plane mates!