How to Let NX Know the Starts and Stops for Centerline Length Measurement

I asked a question on some ideas how to do the measurement to get the distance between the 2 components on an assembly file a few days ago. I did some study on some of the issues and I would like to understand some of the possible ways to let the program knows when to start and to stop a measurement.

In my example, how can I let the program know the left housing is a starting point, and the right housing is stopping point? There are multiple branches.

Example image: http://i67.tinypic.com/262bl1e.png
Previous question: http://www.nxjournaling.com/content/get-distance-between-2-parts-assembly

You will need to create or extract curves that represent the path from the first housing to the 2nd housing; once you have the curve(s), you can use the "measure length" command to report the length of the curve(s).

Can you provide some methods or sample code to do the extraction? My first thought: there might be something to let the application know that left-housing cut the tube at point X and the right housing cut the tube at point Y (In the future, I would like to extend to also other components, not just the housing), however, what kind of criteria to determine the intersection for the 2 components to the tube? Anyway, I will do some sample code to see if I can solve the problem when I get home.