Yes, it is possible and there's no need to use it as flexible part.
Change the assembly type of the rod to Cylinder thus creating mechanism. Now, go to the mechanism module and choose the cylinder connection in the mechanism tree, RMB and Edit Definition. Now set the orientation and define zero point and stroke (to make things easier, position the rod to the zero point and then choose Set to zero button on the Edit definition popup). For the stroke set the upper limit to desired stroke value. Lower limit is to be set to zero.
You're done.