How could we keep a distance between parts over a specified path

Is there any way to keep a specific distance between parts that move over a specified path?

The distance should measure the distance of the path that is between the parts.  

The main problem is that if we have a distance mate, when the path is not a line then it does not work, because it measures the distance between the parts and not the distace of the path between tha parts!!

I would appreciate your help

SolidworksAssemblies