Pipe by object and path

 1from SketchAPI import *
 2
 3from salome.shaper import model
 4
 5model.begin()
 6partSet = model.moduleDocument()
 7Part_1 = model.addPart(partSet)
 8Part_1_doc = Part_1.document()
 9Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
10SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
11SketchPoint_1 = SketchProjection_1.createdFeature()
12SketchCircle_1 = Sketch_1.addCircle(0, 0, 40)
13SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchCircle_1.center())
14SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 40)
15model.do()
16Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
17Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
18SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
19SketchLine_1 = SketchProjection_2.createdFeature()
20SketchArc_1 = Sketch_2.addArc(30, 0, 0, 0, 40.50885209855912, 28.09918197333542, True)
21SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchLine_1.result(), SketchArc_1.center())
22SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchArc_1.startPoint())
23SketchConstraintRadius_2 = Sketch_2.setRadius(SketchArc_1.results()[1], 30)
24model.do()
25Pipe_1 = model.addPipe(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], model.selection("EDGE", "Sketch_2/SketchArc_1_2"))
26model.do()
27model.end()

Download this script