SketchLine_8 = Sketch_1.addLine(0, 3, 8, 3)
SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_8.startPoint())
SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_8.endPoint())
-model.do()
-Part_1_doc.setCurrentFeature(Fill_1.feature(), True)
model.end()
# check that the plane is located as previously
# update the parameter N => number of sketch contours is changed
Param_N.setValue(4)
-Part_1_doc.setCurrentFeature(None, True)
-model.do()
-Part_1_doc.setCurrentFeature(Cut_1.feature(), True)
model.end()
assert(Cut_1.result().numberOfSubs() == 4)
model.do()
# make sketch_2 cut the whole top face of the initial extrusion, so, one of the cylinder becomes invalid
lenParam.setValue(100)
-Part_1_doc.setCurrentFeature(Cylinder_2.feature(), True)
model.do()
# update selection of cylinder base points
model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2)(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_6)(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_3)]").fillAttribute(Cylinder_1.basePoint())
void end()
{
+ // some operations make the current feature not the last one (like "galeries" change parameters)
+ DocumentPtr anActive = ModelAPI_Session::get()->activeDocument();
+ int aSize = anActive->size("Features");
+ if (aSize > 0) {
+ FeaturePtr aLastFeat =
+ std::dynamic_pointer_cast<ModelAPI_Feature>(anActive->object("Features", aSize - 1));
+ anActive->setCurrentFeature(aLastFeat, true);
+ }
+
ModelAPI_Session::get()->finishOperation();
// to update data tree in the end of dumped script execution
ModelAPI_EventCreator::get()->sendReordered(FeaturePtr());
Part_1_doc.removeFeature(Split_1.feature())
model.do()
model.checkSketch(Sketch_2, 0)
-
-Part_1_doc.setCurrentFeature(Extrusion_2.feature(), True)
-
model.end()
assert(model.checkPythonDump())