You could check out the dbIntersectObject command, that will return you the distance between 2 points where the distance is measured from the first point, to where the line intersects the first of the objects in the range of objects to be checked, on the way to the second point.
An easier method though would be to record the position of where you are measuring from and the position of where you are checking to and use some square root maths to find the distance..
I think its something like :
float GetDist(float Ax, float Ay, float Az, float Bx, float By, float Bz)
{
// point A is where you are measuring FROM
// point B is where you are measuring TO
float dx = Ax-Bx;
float dy = Ay-By;
float dz = Az-Bz;
float distance = sqrt(dx*dx + dy*dy + dz*dz);
// could use GDK command :
// float distance = dbSqrt(dx*dx + dy*dy + dz*dz);
return distance;
};
Im pretty sure thats it, but could be wrong, double check the maths to make sure before you use it...
If it ain't broke.... DONT FIX IT !!!