tutorial ....animation rack and pinion by CATIA
6 Answer

add pin which rotate the pinion according to it as fixed part
Answered with a tutorial: https://grabcad.com/tutorials/tutorial-animation-rack-and-pinion-by-catia--1

use rack joint which include (prismatic and revolute joint )
1-make the revolute joint between the pin and pinion
Answered with a tutorial: https://grabcad.com/tutorials/tutorial-animation-rack-and-pinion-by-catia--2

make prismatic joint between also the pin and rack
open new sketch on pin and draw line but coincident to any line of the geomtery of the rack
Answered with a tutorial: https://grabcad.com/tutorials/tutorial-animation-rack-and-pinion-by-catia--3

then select drawn line of pin with the applicable line of the rack
and select face of the pin and parllel face of rack
Answered with a tutorial: https://grabcad.com/tutorials/tutorial-animation-rack-and-pinion-by-catia--4

choose rack joint from kinematic menu and
define select first prismatic joint the select revolute joint
there is small box (ratio ) define from it pitch circle diamater
then select length driven (or) angle driven as your mechanism
Answered with a tutorial: https://grabcad.com/tutorials/tutorial-animation-rack-and-pinion-by-catia--5

here the tutorial
Answered with a tutorial: https://grabcad.com/tutorials/tutorial-animation-rack-and-pinion-by-catia