In the attached model is the approach listed above as a user command called findIntersectionsBetweenPoints() that takes two points in model space and returns a list of objects it crosses and a list of intersection points. It's called in the onDraw of the cylinder, which then draws the intersection points as green spheres on a line between two flow items that are circulating on the conveyors.

/**Custom Code*/
Vec3 L1=param(1); //The first point of the line in model space
Vec3 L2=param(2); // The second point of the line in model space
Array omit=param(3); //The array of objects to omit from tests.
Vec3 L12 =L2-L1; // The vector between the two points on the line
double lineMag=L12.magnitude; //length of the line
Vec3 L21=L12*-1; // The reverse vector of the line
Vec3 mid=Vec3(0.5,0.5,0.5);
Object o=model().last;
Vec3 oCen;
Vec3 L1toCen;
double dist=0;
string pathstr;
double objDiagLen;
Array objects=[];
Array intersections=[];
forobjecttreeunder(model()){
if (getdatatype(a)==DATATYPE_OBJECT&& omit.indexOf(a)==-1){
pathstr=nodetopath(a,1);
if (not(pathstr.startsWith("MODEL:/Tools"))){
o=a;
oCen=o.getLocation(mid); //get the centre point of the object's oriented bounding box (OBB)
L1toCen=oCen-L1; // the vector from the start of our line to the object centre
dist=L1toCen.cross(L12).magnitude/lineMag; // distance of the centre to out line at the shortest point
objDiagLen=sqrt(sqr(o.size.x)+sqr(o.size.y)+sqr(o.size.z)); // the length of the OBB diagnonal.
int possIntersect=dist<objDiagLen/2; // could it intersect the line 1/0
if (possIntersect){
int intersected=0;
Vec3 pa0=o.getLocation(0,0,0).project(o.up,model());
Vec3 pa1=o.getLocation(1,0,0).project(o.up,model());
Vec3 pa2=o.getLocation(0,1,0).project(o.up,model());
Vec3 pa3=o.getLocation(0,0,1).project(o.up,model());
Vec3 pb0=o.getLocation(1,1,1).project(o.up,model());
Vec3 pb1=o.getLocation(0,1,1).project(o.up,model());
Vec3 pb2=o.getLocation(1,0,1).project(o.up,model());
Vec3 pb3=o.getLocation(1,1,0).project(o.up,model());
Array planes= [[pa0,pa1-pa0,pa2-pa0]
,[pa0,pa1-pa0,pa3-pa0]
,[pa0,pa2-pa0,pa3-pa0]
,[pb0,pb1-pb0,pb2-pb0]
,[pb0,pb1-pb0,pb3-pb0]
,[pb0,pb2-pb0,pb3-pb0]];
for (int n=6;n>0;n--){ // Use n>0&&!intersected if you don't want all the intersection points
Vec3 p0=planes[1]; //common corner point in model space
Vec3 p01=planes[2]; //vector along edge1
Vec3 p02=planes[3]; //vector along edge2
double denom=L21.dot(p01.cross(p02));
if (denom==0) //no solution
continue;
double t=p01.cross(p02).dot(L1-p0)/denom;
double u=p02.cross(L21).dot(L1-p0)/denom;
double v=L21.cross(p01).dot(L1-p0)/denom;
if (u>=0&&u<=1&&v>=0&&v<=1&&t>=0&&t<=1) { //solution is in this plane of the OBB
intersected=1;
objects.push(o);
intersections.push(L1+L12*t);
}
}
}
}
}
}
return [objects, intersections];ObjectsBetweenTwoPoints.fsm