Part_1_doc = Part_1.document() Face_1 = model.addFace(Part_1_doc, [ model.selection( "FACE", "PartSet/Sketch_1/Face-SketchLine_12r-SketchLine_11r-SketchLine_10r-SketchLine_9r-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r" ) ]) Extrusion_1 = model.addExtrusion(Part_1_doc, [ model.selection( "FACE", "PartSet/Sketch_1/Face-SketchLine_12r-SketchLine_11r-SketchLine_10r-SketchLine_9r-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r" ) ], model.selection(), F, 0) Fillet_1 = model.addFillet(Part_1_doc, [ model.selection( "EDGE", "[Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_7][Extrusion_1_1/To_Face]" ) ], R1) Fillet_2 = model.addFillet(Part_1_doc, [ model.selection( "EDGE", "[Fillet_1_1/MF:Fillet&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_5]" ) ], R1) Fillet_3 = model.addFillet(Part_1_doc, [ model.selection( "EDGE", "[Fillet_1_1/MF:Fillet&PartSet/Sketch_1/SketchLine_7][Extrusion_1_1/From_Face]" ) ], R1) Fillet_4 = model.addFillet(Part_1_doc, [
SketchConstraintDistanceHorizontal_1 = Sketch_2.setHorizontalDistance( SketchAPI_Point(SketchPoint_2).coordinates(), SketchCircle_2.center(), A / 2) model.do() Face_2 = model.addFace(Part_1_doc, [ model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchCircle_1_2r") ]) ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [ model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchCircle_1_2r") ], model.selection(), 0, D, [model.selection("SOLID", "Extrusion_1_1")]) Fillet_1 = model.addFillet(Part_1_doc, [ model.selection( "EDGE", "[ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][(ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/From_Face)(ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face)(ExtrusionCut_1_1/Modified_Face&ExtrusionCut_1_1/From_Face)]" ) ], R1) Fillet_2 = model.addFillet(Part_1_doc, [ model.selection( "EDGE", "[Fillet_1_1/MF:Fillet&Sketch_1/SketchCircle_2_2][ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/From_Face]" ) ], R1) Fillet_3 = model.addFillet(Part_1_doc, [ model.selection( "EDGE", "[Fillet_2_1/MF:Fillet&Extrusion_1_1/From_Face][(Fillet_2_1/MF:Fillet&Extrusion_1_1/From_Face)(Fillet_2_1/MF:Fillet&ExtrusionCut_1_1/From_Face)(Fillet_2_1/MF:Fillet&PartSet/Sketch_1/SketchLine_1)2(Fillet_2_1/MF:Fillet&Sketch_1/SketchCircle_2_2)2(Fillet_2_1/GF:Fillet&Fillet_2_1/FilletSelected)2(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected)2(Fillet_1_1/MF:Fillet&Extrusion_1_1/To_Face)2(Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_2)2(Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_3)2(Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_4)2(ExtrusionCut_1_1/Generated_Face&Sketch_1/SketchCircle_1_2)2]" ) ], R1) Fillet_4 = model.addFillet(Part_1_doc, [
SketchConstraintCoincidence_18 = Sketch_3.setCoincident(SketchLine_14.endPoint(), SketchLine_10.result()) SketchConstraintEqual_1 = Sketch_3.setEqual(SketchLine_5.result(), SketchLine_11.result()) SketchConstraintLength_3 = Sketch_3.setLength(SketchLine_5.result(), (D-D1)/2) SketchProjection_6 = Sketch_3.addProjection(model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_2]"), False) SketchPoint_3 = SketchProjection_6.createdFeature() SketchConstraintDistanceHorizontal_2 = Sketch_3.setHorizontalDistance(SketchAPI_Point(SketchPoint_3).coordinates(), SketchLine_7.endPoint(), (A-D)/2) SketchProjection_7 = Sketch_3.addProjection(model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_3]"), False) SketchPoint_4 = SketchProjection_7.createdFeature() SketchConstraintDistanceHorizontal_3 = Sketch_3.setHorizontalDistance(SketchLine_14.startPoint(), SketchAPI_Point(SketchPoint_4).coordinates(), (A-D)/2) model.do() Face_3 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_1r-SketchLine_3f-SketchLine_4f-SketchLine_5f")]) Face_4 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_11r-SketchLine_10r-SketchLine_9r-SketchLine_7r")]) ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Face_3_1")], model.selection(), 0, C, [model.selection("SOLID", "ExtrusionCut_1_1")]) ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_11r-SketchLine_10r-SketchLine_9r-SketchLine_7r")], model.selection(), 0, C, [model.selection("SOLID", "ExtrusionCut_2_1")]) Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[(ExtrusionCut_3_1/Modified_Face&PartSet/Sketch_1/SketchLine_1)(ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/To_Face)(ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/From_Face)2(Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_4)2(Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_2)2(Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_3)2][ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/To_Face]")], R1) Fillet_2 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Fillet_1_1/MF:Fillet&Sketch_2/SketchLine_9][(Fillet_1_1/MF:Fillet&PartSet/Sketch_1/SketchLine_1)(Fillet_1_1/MF:Fillet&Sketch_2/SketchLine_9)(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected)2(Fillet_1_1/MF:Fillet&Extrusion_1_1/To_Face)2(Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_4)2(ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/From_Face)2(Fillet_1_1/MF:Fillet&Sketch_2/SketchLine_10)2]")], R3) Fillet_3 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[(Fillet_2_1/MF:Fillet&PartSet/Sketch_1/SketchLine_1)(Fillet_2_1/MF:Fillet&Sketch_1/SketchCircle_2_2)(Fillet_2_1/MF:Fillet&ExtrusionCut_1_1/From_Face)(Fillet_2_1/MF:Fillet&Sketch_2/SketchLine_9)2(Fillet_2_1/GF:Fillet&Fillet_2_1/FilletSelected)2(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected)2(Fillet_1_1/MF:Fillet&Extrusion_1_1/To_Face)2(Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_4)2(ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/From_Face)2(Fillet_2_1/MF:Fillet&Sketch_2/SketchLine_10)2][(Fillet_2_1/MF:Fillet&PartSet/Sketch_1/SketchLine_1)(ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/From_Face)(Fillet_2_1/MF:Fillet&Sketch_2/SketchLine_9)2(Fillet_2_1/GF:Fillet&Fillet_2_1/FilletSelected)2(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected)2(Fillet_2_1/MF:Fillet&Sketch_1/SketchCircle_2_2)2(Fillet_1_1/MF:Fillet&Extrusion_1_1/To_Face)2(Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_4)2(Fillet_2_1/MF:Fillet&ExtrusionCut_1_1/From_Face)2(Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_3)2(Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_2)2]")], R3) Fillet_4 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[(ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/From_Face)(ExtrusionCut_2_1/Modified_Face&Sketch_1/SketchCircle_2_2)(Fillet_3_1/MF:Fillet&PartSet/Sketch_1/SketchLine_1)2(Fillet_3_1/MF:Fillet&Sketch_2/SketchLine_9)2(Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_4)2(Fillet_1_1/MF:Fillet&Extrusion_1_1/To_Face)2(Fillet_3_1/MF:Fillet&Sketch_2/SketchLine_10)2(Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_2)2(Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_3)2][ExtrusionCut_2_1/Modified_Face&Sketch_1/SketchCircle_2_2]")], R3) Fillet_5 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Fillet_4_1/MF:Fillet&Sketch_1/SketchCircle_2_2][(Fillet_4_1/MF:Fillet&PartSet/Sketch_1/SketchLine_1)(Fillet_4_1/MF:Fillet&Sketch_1/SketchCircle_2_2)(Fillet_1_1/MF:Fillet&Extrusion_1_1/To_Face)]")], R3) Fillet_6 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Fillet_5_1/MF:Fillet&Sketch_2/SketchLine_3][Fillet_1_1/MF:Fillet&Extrusion_1_1/To_Face]")], R1) Fillet_7 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/From_Face][Fillet_4_1/MF:Fillet&Sketch_2/SketchLine_3]")], R1) Fillet_8 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Fillet_7_1/MF:Fillet&Extrusion_1_1/From_Face][Fillet_3_1/MF:Fillet&Sketch_2/SketchLine_9]")], R1) Fillet_9 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_4][Fillet_6_1/MF:Fillet&Extrusion_1_1/To_Face]")], R2) Fillet_10 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Fillet_9_1/MF:Fillet&PartSet/Sketch_1/SketchLine_4][Fillet_8_1/MF:Fillet&Extrusion_1_1/From_Face]")], R2) Fillet_11 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Fillet_9_1/MF:Fillet&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_2]")], R2) Fillet_12 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Fillet_11_1/MF:Fillet&PartSet/Sketch_1/SketchLine_2][Fillet_10_1/MF:Fillet&Extrusion_1_1/From_Face]")], R2) #Exportez le fichier ".XAO" dans le dossier ./temp Export_1 = model.exportToXAO(Part_1_doc, adresse_temp+'\\shaper_pbc8yjek.xao', model.selection("SOLID", "Fillet_12_1"), 'XAO')
SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result()) SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result()) SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()) SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_2.startPoint(), SketchLine_1.startPoint(), A) SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_4.endPoint(), SketchLine_3.endPoint(), B) SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "Origin"), False) SketchPoint_1 = SketchProjection_1.createdFeature() SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchAPI_Point(SketchPoint_1).coordinates()) model.do() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "PartSet/Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")]) Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "PartSet/Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), C, 0) Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]")], R) Fillet_2 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Fillet_1_1/MF:Fillet&PartSet/Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]")], R) Fillet_3 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Fillet_1_1/MF:Fillet&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_2]")], R) Fillet_4 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Fillet_3_1/MF:Fillet&PartSet/Sketch_1/SketchLine_2][Fillet_2_1/MF:Fillet&Extrusion_1_1/From_Face]")], R) #Exportez le fichier ".XAO" dans le dossier ./temp Export_1 = model.exportToXAO(Part_1_doc, adresse_temp+'\\shaper_mve3cacu.xao', model.selection("SOLID", "Fillet_4_1"), 'XAO') model.end() ### ### GEOM component ### import GEOM from salome.geom import geomBuilder
Part_1_doc = Part_1.document() Face_1 = model.addFace(Part_1_doc, [ model.selection( "FACE", "PartSet/Sketch_1/Face-SketchLine_12r-SketchLine_11r-SketchLine_10r-SketchLine_9r-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r" ) ]) Extrusion_1 = model.addExtrusion(Part_1_doc, [ model.selection( "FACE", "PartSet/Sketch_1/Face-SketchLine_12r-SketchLine_11r-SketchLine_10r-SketchLine_9r-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r" ) ], model.selection(), F, 0) Fillet_1 = model.addFillet(Part_1_doc, [ model.selection( "EDGE", "[Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_12][Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_1]" ) ], R2) Fillet_2 = model.addFillet(Part_1_doc, [ model.selection( "EDGE", "[Fillet_1_1/MF:Fillet&PartSet/Sketch_1/SketchLine_12][Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_11]" ) ], R2) Fillet_3 = model.addFillet(Part_1_doc, [ model.selection( "EDGE", "[Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_9][Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_8]" ) ], R1) Fillet_4 = model.addFillet(Part_1_doc, [