Mate by equation?

Hi,

Can we use equation to control mates? For example, I might have a two boxes, A and B, and I would like the distance between their top faces = 2×(height A + height B). Can we use equation to do this?

Qi

SolidworksAssemblies