@mad.kaveh I was curious if I could take a completely different approach and try to solve the tangency condition mathematically and then use Position Scripts to locate the tangent points on the two upper most tubes. A single straight spline would be used to go from, for example, tube1 (linked to circle 1) and tube 10 (linked to circle 2). The spline bridging the other tubes does not change while tube1 and tube 10 are the effective outer tubes. As cirlcle1 turns there would eventually be a point where the tangent points move to the next tube in rotation.
The attached file uses two position scripts to locate two point (Pt1, Pt2). The location of Pt1 is the vector addition of the vector to the center of tube1 (tube1w = tube1 in world coordinates, I linked tube1 to circle 1) plus a vector perpendicular to the unit vector from tube 1 to tube 10 times the radius of the tube (I used 22).

Note, in this example I use a convention to end variable names for transforms with a "T" and positions with a "P".
You can rotate either circle 1 or circle 2 and the spline will maintain tangency.
The next task would be to relate the rotation of circle 2 to circle 1. The bigger task is to determine the amount of rotation that should cause different tubes to be used and then how to make that change.
If you think this approach has promise I could see how far I could take it.
Lee
lee.minardi