When you create a shape tweened animation, you can use anchor points called "shape hints".
Create a line in frame 1. insert a keyframe wherever you want, i used frame 20. Double-click frame 1 and in the Tweening tab select Shape tweening. You will see the frames in the timeline become green. Now press MODIFY/TRANSFORM/ADD SHAPE HINT. Now you will see a little yellow circle with an "A" inside it. Drag the circle to the vertex where you want your pivot point.
Go to frame 20 (or whatever you selected) You will have a green circle with the same letter "A". Drag the circle to the same vertex as you did before. Now, grab the other line vertex and move it wherever you want it.(like a mechanical arm you wanted) Press enter and you will see the animation.
You can create complicated animations this way. The limitation is that you can only create up to 26 shape hints (26 letters in the alphabet)
I hope that answers your question.