How to join a part from two points simultaneously

Hi,
I was just wondering how i can join two parts together (part A & part B), while aligning two shafts (on part A) with their respective housings (on part B). See attached pics for further details.
Thanks