NetLogo 7.0.0-beta2:

nw:distance-to

nw:distance-to target-turtle

Finds the shortest path to the target turtle and reports the total distance for this path, or false if no path exists in the current context. Each link counts for a distance of one.

Example:

Will output:

Take me to the full Networks Extension Dictionary