SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchArc_15.startPoint(), SketchAPI_Arc(SketchArc_12).startPoint())
SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchArc_3.endPoint(), SketchAPI_Arc(SketchArc_6).endPoint())
model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchArc_1_2f-SketchArc_2_2f-SketchArc_3_2f-SketchArc_4_2r-SketchArc_5_2r-SketchCircle_1_2r-SketchArc_6_2r-SketchArc_7_2r-SketchLine_6f-SketchLine_7f-SketchArc_8_2f-SketchArc_9_2f-SketchLine_8f-SketchLine_9f-SketchArc_10_2f-SketchArc_11_2f-SketchLine_10f-SketchLine_11f-SketchArc_12_2r-SketchArc_13_2r-SketchCircle_2_2r-SketchCircle_3_2r-SketchArc_14_2f-SketchArc_15_2f")], model.selection(), 10, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchArc_1_2f-SketchLine_3f-SketchArc_2_2f-SketchLine_4f-SketchArc_5_2r-SketchArc_3_2f-SketchArc_6_2r-SketchLine_6f-SketchArc_8_2f-SketchLine_8f-SketchArc_10_2f-SketchLine_10f-SketchArc_12_2r-SketchArc_15_2f-SketchArc_7_2r-SketchLine_7f-SketchArc_9_2f-SketchLine_9f-SketchArc_11_2f-SketchLine_11f-SketchArc_13_2r-SketchArc_14_2f-SketchArc_4_2r-SketchCircle_1_2r-SketchCircle_2_2r-SketchCircle_3_2r")], model.selection(), 10, 0)
model.do()
model.end()
aGroupFeature.data().setName("")
aSelectionListAttr = aGroupFeature.selectionList("group_list")
aSelectionListAttr.setSelectionType("face")
- aSelectionListAttr.append("box1_1/Shape1")
- aSelectionListAttr.append("box1_1/Shape2")
+ aSelectionListAttr.append("box1_1/Shape_1")
+ aSelectionListAttr.append("box1_1/Shape_2")
aSession.finishOperation()
aSession.startOperation("Create a field")
aField = aSession.activeDocument().addFeature("Field")
aSelectionListAttr = aField.selectionList("selected")
aSelectionListAttr.setSelectionType("face")
- aSelectionListAttr.append("box1_1/Shape1")
- aSelectionListAttr.append("box1_1/Shape2")
+ aSelectionListAttr.append("box1_1/Shape_1")
+ aSelectionListAttr.append("box1_1/Shape_2")
aComponentNames = aField.stringArray("components_names")
aComponentNames.setSize(2) # two components
aComponentNames.setValue(0, "temperatue")
SketchConstraintParallel_2 = Sketch_1.setParallel(SketchLine_2.result(), SketchLine_4.result())
SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_4.result())
model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), 50, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 50, 0)
# Create a group with the faces of the box
-Group_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_2"), model.selection("FACE", "Extrusion_1_1/From_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("FACE", "Extrusion_1_1/To_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_3")]
+Group_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2"), model.selection("FACE", "Extrusion_1_1/From_Face"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"), model.selection("FACE", "Extrusion_1_1/To_Face"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3")]
Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
Group_1.setName("Group_faces")
Group_1.result().setName("Group_faces")
# Create a field on the box
-Field_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_2"), model.selection("FACE", "Extrusion_1_1/From_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("FACE", "Extrusion_1_1/To_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_3")]
+Field_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2"), model.selection("FACE", "Extrusion_1_1/From_Face"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"), model.selection("FACE", "Extrusion_1_1/To_Face"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3")]
Field_1 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], Field_1_objects)
Field_1.addStep(0, 0, [[0], [1], [2], [3], [4], [5], [6]])
# Create a plane to split the box in two parts
aSelectionList = aFeature2.selectionList("group_list")
assert aSelectionList.selectionType() == "face"
assert aSelectionList.size() == 2
- assert aSelectionList.value(0).namingName("") == "mygeom_1/Shape1"
- print(aSelectionList.value(1).namingName(""))
- assert aSelectionList.value(1).namingName("") == "mygeom_1/Shape2"
+ assert aSelectionList.value(0).namingName("") == "mygeom_1/Shape_1"
+ assert aSelectionList.value(1).namingName("") == "mygeom_1/Shape_2"
aFeature3 = aCompositeFeature.subFeature(2, False)
assert aFeature3.getKind() == "Field"