User:Eriossoltero/fr

=User:Eriossoltero/fr=

import Part, FreeCAD, math, PartGui, FreeCADGui from FreeCAD import Base
 * 1) Macro Begin: Ellipse-Center+2Points.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++
 * 2) http://freecad-tutorial.blogspot.com/2011/12/engine-9-poly-v-belt.html

s = FreeCADGui.Selection.getSelection try: sel1=s[0].Shape sel2=s[1].Shape sel3=s[2].Shape except: print "Wrong selection"
 * 1) get the selected objects, with first selection for the trajectory and second for the section
 * 2) Adapted from:
 * 3) http://freecad-tutorial.blogspot.com/2011/12/engine-9-poly-v-belt.html

pt_center = sel1.Point pt_radmay = sel2.Point pt_radmen = sel3.Point

myObject=App.ActiveDocument.addObject("Part::Feature","Ellipse")
 * 1) create Part object in the current document

ellipse = Part.Ellipse(pt_radmay, pt_radmen, pt_center) myObject.Shape = ellipse.toShape
 * 1) create a shape and assign it to the current document
 * 1) Macro End: Ellipse-Center+2Points.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++