Can I do a global variables across two parts in an assembly?

I have two parts in an assembly. They are male and female. I want to link the variables together. How to do that?

SolidworksGeneral