I've tried this:

....

$index[0] = $mymesh.AddPoint((0.000000, 1.000000, 0.000000));

$index[1] = $mymesh.AddPoint((0.343292, 0.939229, 0.000000));

....

float $rx, $ry, $rz;

point3 $p1, $p2;

$p1 = $mymesh.GetPoint($index[0]);

$p2 = $mymesh.GetPoint($index[1]);

float $CylLen;

$CylLen = sqrt(pow($p1.x-$p2.x, 2) + pow($p1.y-$p2.y, 2) + pow($p1.z-$p2.z, 2));

shape $cyl0;

$cyl0 = cylinder($CylRad, $CylLen);

$cyl0.lon = 8;

$cyl0.lat = 1;

$cyl0.CapStart = 0;

$cyl0.CapEnd = 0;

$cyl0.loc = ($p2.x, $p2.y, $p2.z);

$rx = 0;

if(($p1.x-$p2.x) < 0) { $ang = 180; } else { $ang = 0; }

$ry = $ang + atan(($p1.z-$p2.z)/($p1.x-$p2.x)) * 180.0 / $PI2;

$rz = acos(($p1.y-$p2.y) / $CylLen ) * 180.0 / $PI2;

$cyl[$i].orientation = RPYtoQuaternion($rx, $ry, $rz);

it ALMOST works. The cylinder is positioned not very precise.