**Introduction** FreeCAD has been built using the programming language Python. It should be understood that the use of modeling using the Python command line is not required. However, it can be beneficial in certain circumstances: *To design surfaces/curves using a specific mathematical formula *Importing design features from other python based programs/simulations *To create macros/scripts to design parametric libraries for various parts In this tutorial we will focus on the last of the 3 circumstances. It is our goal to design a macro that allows us to create parametrically designed pullies. The basic pulley has been chosen for it's relative simplicity. Once the overall design/programming principles are understood I would like to create macros for: *Internal/External involute gears adapted to laser cutting (this is already included in the FreeCAD package *Roller Bearings for the 3Dprinting / laser cutting *Cam shafts *Screw drives In this tutorial we will be making a very simplified version of this object: {{ :wiki:tutoriels:freecad4.jpg?300 |}} **STEP 1 - Setup FreeCAD for Python Script Building:** {{ :wiki:tutoriels:freecad1.png?800 |}} When we first open FreeCAD you will not have the "Vue Rapport" nor the "Python Console". So the first step is to learn how to activate these two menus {{ :wiki:tutoriels:freecad2.png?800 |}} Open the menu: Edition/Préférences/fenêtre de sortie *Select "Rediriger les messages interne Python vers la vue rapport" *Select "Rediriger les erreurs internes de Python vers la vue rapport" *Select "Appliquer" et "OK" {{ :wiki:tutoriels:freecad3.png?800 |}} Next we will activate the menus for the Python Console and the Vue Rapport. To do so we must: *Goto the tab menu Affichage/Panneaux *Select "Vue Rapport" *Select "Vue Combinée" *Select "Console Python" **Step 2 - Basics** Now that we have our Python Console open we will start with the very basics. We will simply create a new document named "Python_Pulley" then: * Create two cylinders of a diameter = D with a thickness = T * Space them apart along the xy plane with a distance =d * Create a third cylinder with a thickness =d and a diameter