ok you don't need to search though all that code:
to get the
parent:
listRelatives -p <<object name>>
children:
listRelatives -c <<object name>>
to calculate the length of a joint just get the position of joint1 and then joint2 and do some vector maths to give you the length between them:
global proc float getJointLength(string $jnt1, string $jnt2)
{
//get jnt1 worldspace position
float $jnt1Pos[] = `xform -q -ws -t $jnt1`;
//get jnt2 worldspace position
float $jnt2Pos[] = `xform -q -ws -t $jnt2`;
//calculate the vector between them
float $xcomp = $jnt2Pos[0] -$jnt1Pos[0];
float $ycomp = $jnt2Pos[1] -$jnt1Pos[1];
float $zcomp = $jnt2Pos[2] -$jnt1Pos[2];
vector $tmp = << $xcomp, $ycomp, $zcomp>>;
//get the vector length
float $res = mag($tmp);
return $res;
}
getJointLength("joint1", "joint2");
and what do you mean by "head and tail"?

A
Technical Director - Framestore
Currently working on: Your Highness
IMDB