Example Slider Mechanism

ground = 1;
crank = 2;
slider = 3;

SetBodies[
Body[
        ground, 
PointList -> {{0, 10, 12},  {10, 10, 
              12}, {1, 0, 0}, {0, 1, 0}}], 
Body[crank, 
        PointList -> {{8, 0, 0}, {0, 8, 
              0}}, 
InitialGuess -> {{0, 10, 12}, {1, 
              0, 0, 0}}], 
Body[slider,  
        PointList -> {{1, 0, 0}, {0, 1, 
              0}}, 
InitialGuess -> {{20, 0, 0}, {1, 
              0, 0, 0}}]]

\(SetConstraints[
Revolute5[1, \ 
        Line[ground, \ 1, \ 2], 
			Line[crank, \ 0, \ 
          1]], 
ProjectedAngle1[2, \ 
        Line[crank, \ 0, 2], 
					Line[ground, \ 0, 
          4], 
					Line[ground, \ 0, 3], 
        2\ N[Pi]\ T], 
RelativeDistance1[3, \ 
        Point[crank, \ 2], 
					Point[slider, \ 0], \ 
        30.0], 
Translate5[4, \ 
        Axis[ground, 0, 3, 4], 
			Axis[slider, 0, 1, 
          2]]]\)

\(\(groundgraphic = 
        Graphics3D[{Thickness[ .008], 
Line[{{\(-1\), \(-5\), 0}, \ {\(-1\), 18, 0}, {35, 18, 0}, {35, \ \(-5\), \ 
                  0}, 
	{\(-1\), \ \(-5\), 
                  0}, {\(-1\), \(-5\), 22}, {\(-1\), 18, 22}, {\(-1\), 18, 
                  0}}], 
Line[{{\(-1\), 1.8, 0}, {35, 1.8, 
                  0}}], 
Line[{{\(-1\), \(-1.8\), 
                  0}, {35, \ \(-1.8\), 0}}], 
Edge[
              ground, {1, 2}]}];\)\)

groundtext = 
        Graphics3D[
{Text["{0,10,12}", 
              Location[ground, 
                1], {0.5,  -1.6}], 
Text["P1",  
              Location[ground,  1], {1.3,  
                0.9}], 
Text["{10,10,12}",  
              Location[ground, 2], {- .5,  
                1.6}], 
Text["P2", 
              Location[ground, 
                2], {-1.3, -0.9}], 
Text[
              FontForm["Ground",  {"Times-Bold",  12}],  {24, 7, 
                23}], 
LocalAxes[ground,  
              8]}];

plot1 = 
        Show[{groundgraphic,  groundtext}, 
          PlotRange -> {{-2, 37},  {-10, 20},  {-4, 
                24}}];

crankgraphic = 
        Graphics3D[{
Bar[Line[crank, 0, {-1, 0, 0}],  
              10.0,  12]}];

cranktext = 
        Graphics3D[
{Text["{8,0,0}",  
              Location[crank,  1], {-0.4,  
                1.6}], 
Text["P1",  
              Location[crank,  
                1], {-1.9, -0.9}], 
Text["{0,8,0}\
",  Location[crank,  2], {-1.3,  
                0.9}], 
Text["P2",  
              Location[crank,  
                2], {-2.6,  -1.6}], 
LocalAxes[
              crank,  7], 
Text[
              FontForm["Crank",  {"Times-Bold", 12}],  {15, 0, 
                0}]}];

plot2 = 
        Show[{crankgraphic,  cranktext} /. SolveMech[0], 
          PlotRange -> {{-2, 37}, {-10, 20}, {-4, 
                24}}];

slidergraphic = 
        Graphics3D[{
Box[
              slider,  {{-4, -1.5, -2}, {4, 1.5, 
                  2}}]}];

slidertext = 
        Graphics3D[{
LocalAxes[slider,  
              8], 
Text[
              FontForm["Slider", {"Times-Bold",  12}],  {24,  4,  
                23}]}];

plot3 = 
        Show[{slidergraphic,  slidertext} /. SolveMech[0], 
          PlotRange -> {{-2, 37}, {-10, 20}, {-4, 
                24}}];

conrodgraphic = 
        Graphics3D[{
Bar[Line[crank, 2, slider, 0], 1.0, 
              8]}];

conrodtext = 
        Graphics3D[{
Text[
              FontForm["ConnectingRod", {"Times-Bold",  12}], {25, 
                4, 23}]}];

plot4 = 
        Show[{conrodgraphic,  conrodtext} /. SolveMech[0], 
          PlotRange -> {{-2, 37}, {-10, 20}, {-4, 
                24}}];

Show[{groundgraphic,  crankgraphic,  slidergraphic,  
            conrodgraphic} /. SolveMech[0.10], 
        PlotRange -> {{-2, 37}, {-10, 20}, {-4, 
              24}}];