Testing possibility to remove full ellipse and all its construction elements.
std::list<std::string> aResList; // list of resulting strings
for(std::list<ObjectPtr>::iterator aL = aList.begin(); aL != aList.end(); aL++) {
if (aL->get()) {
+ if (isSketchFeatures) {
+ // do not control construction features of an ellipse and other
+ FeaturePtr aFeature = ModelAPI_Feature::feature(*aL);
+ if (aFeature->getKind() == "SketchConstraintCoincidenceInternal")
+ continue; // skip internal constraints
+ }
aResList.push_back((*aL)->data()->name());
} else if (!isSketchFeatures) {
aResList.push_back("__empty__");
std::list<ObjectPtr>::iterator allIter = allObjects.begin();
for(; allIter != allObjects.end(); allIter++) {
ObjectPtr anObject = *allIter;
+ FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(anObject);
+ if (aFeature->getKind() == "SketchConstraintCoincidenceInternal")
+ continue; // no need to dump and check internal constraints
+
if (theCompare) {
std::map<std::string, ModelHighAPI_FeatureStore>::iterator
anObjFind = aDocFind->second.find(anObject->data()->name());
theStore[theDocName][anObject->data()->name()] = ModelHighAPI_FeatureStore(anObject);
}
- FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(anObject);
if (aFeature) {
// iterate all results of this feature
std::list<ResultPtr> allResults;
}
static FeaturePtr createPoint(const CompositeFeaturePtr& theSketch,
- const AttributePtr& theCoincident,
+ const FeaturePtr& theEllipse,
+ const std::string& theCoincident,
const std::string& theAuxOrName)
{
- AttributePoint2DPtr anElPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(theCoincident);
+ AttributePoint2DPtr anElPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ theEllipse->attribute(theCoincident));
FeaturePtr aPointFeature = theSketch->addFeature(SketchPlugin_Point::ID());
AttributePoint2DPtr aCoord = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
aPointFeature->attribute(SketchPlugin_Point::COORD_ID()));
aCoord->setValue(anElPoint->x(), anElPoint->y());
+ aPointFeature->reference(SketchPlugin_Point::PARENT_ID())->setValue(theEllipse);
aPointFeature->execute();
+ std::string aName = theEllipse->name() + "_" + theCoincident;
+ aPointFeature->data()->setName(aName);
+ aPointFeature->lastResult()->data()->setName(aName);
+
if (theAuxOrName == AUXILIARY_VALUE)
aPointFeature->boolean(SketchPlugin_Point::AUXILIARY_ID())->setValue(true);
else if (!theAuxOrName.empty()) {
}
static FeaturePtr createAxis(const CompositeFeaturePtr& theSketch,
- const AttributePtr& theCoincidentStart,
- const AttributePtr& theCoincidentEnd,
+ const FeaturePtr& theEllipse,
+ const std::string& theCoincidentStart,
+ const std::string& theCoincidentEnd,
const std::string& theAuxOrName)
{
AttributePoint2DPtr aStartPoint =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(theCoincidentStart);
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(theEllipse->attribute(theCoincidentStart));
AttributePoint2DPtr aEndPoint =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(theCoincidentEnd);
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(theEllipse->attribute(theCoincidentEnd));
FeaturePtr aLineFeature = theSketch->addFeature(SketchPlugin_Line::ID());
AttributePoint2DPtr aLineStart = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
AttributePoint2DPtr aLineEnd = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
aLineFeature->attribute(SketchPlugin_Line::END_ID()));
aLineEnd->setValue(aEndPoint->x(), aEndPoint->y());
+ aLineFeature->reference(SketchPlugin_Point::PARENT_ID())->setValue(theEllipse);
aLineFeature->execute();
+ std::string aName = theEllipse->name() + "_" +
+ (theCoincidentStart == SketchPlugin_Ellipse::MAJOR_AXIS_START_ID() ?
+ "major_axis" : "minor_axis");
+ aLineFeature->data()->setName(aName);
+ aLineFeature->lastResult()->data()->setName(aName);
+
if (theAuxOrName == AUXILIARY_VALUE)
- aLineFeature->boolean(SketchPlugin_Point::AUXILIARY_ID())->setValue(true);
+ aLineFeature->boolean(SketchPlugin_Line::AUXILIARY_ID())->setValue(true);
else if (!theAuxOrName.empty()) {
aLineFeature->data()->setName(theAuxOrName);
aLineFeature->lastResult()->data()->setName(theAuxOrName);
std::list<FeaturePtr> anEntities;
if (!center.empty()) {
- AttributePtr aCenterAttr = anEllipse->attribute(SketchPlugin_Ellipse::CENTER_ID());
- anEntities.push_back(createPoint(aSketch, aCenterAttr, center));
+ anEntities.push_back(
+ createPoint(aSketch, anEllipse, SketchPlugin_Ellipse::CENTER_ID(), center));
}
if (!firstFocus.empty()) {
- AttributePtr aFocusAttr = anEllipse->attribute(SketchPlugin_Ellipse::FIRST_FOCUS_ID());
- anEntities.push_back(createPoint(aSketch, aFocusAttr, firstFocus));
+ anEntities.push_back(
+ createPoint(aSketch, anEllipse, SketchPlugin_Ellipse::FIRST_FOCUS_ID(), firstFocus));
}
if (!secondFocus.empty()) {
- AttributePtr aFocusAttr = anEllipse->attribute(SketchPlugin_Ellipse::SECOND_FOCUS_ID());
- anEntities.push_back(createPoint(aSketch, aFocusAttr, secondFocus));
+ anEntities.push_back(
+ createPoint(aSketch, anEllipse, SketchPlugin_Ellipse::SECOND_FOCUS_ID(), secondFocus));
}
if (!majorAxisStart.empty()) {
- AttributePtr aStartAttr = anEllipse->attribute(SketchPlugin_Ellipse::MAJOR_AXIS_START_ID());
- anEntities.push_back(createPoint(aSketch, aStartAttr, majorAxisStart));
+ anEntities.push_back(
+ createPoint(aSketch, anEllipse, SketchPlugin_Ellipse::MAJOR_AXIS_START_ID(), majorAxisStart));
}
if (!majorAxisEnd.empty()) {
- AttributePtr aEndAttr = anEllipse->attribute(SketchPlugin_Ellipse::MAJOR_AXIS_END_ID());
- anEntities.push_back(createPoint(aSketch, aEndAttr, majorAxisEnd));
+ anEntities.push_back(
+ createPoint(aSketch, anEllipse, SketchPlugin_Ellipse::MAJOR_AXIS_END_ID(), majorAxisEnd));
}
if (!minorAxisStart.empty()) {
- AttributePtr aStartAttr = anEllipse->attribute(SketchPlugin_Ellipse::MINOR_AXIS_START_ID());
- anEntities.push_back(createPoint(aSketch, aStartAttr, minorAxisStart));
+ anEntities.push_back(
+ createPoint(aSketch, anEllipse, SketchPlugin_Ellipse::MINOR_AXIS_START_ID(), minorAxisStart));
}
if (!minorAxisEnd.empty()) {
- AttributePtr aEndAttr = anEllipse->attribute(SketchPlugin_Ellipse::MINOR_AXIS_END_ID());
- anEntities.push_back(createPoint(aSketch, aEndAttr, minorAxisEnd));
+ anEntities.push_back(
+ createPoint(aSketch, anEllipse, SketchPlugin_Ellipse::MINOR_AXIS_END_ID(), minorAxisEnd));
}
if (!majorAxis.empty()) {
- AttributePtr aStartAttr = anEllipse->attribute(SketchPlugin_Ellipse::MAJOR_AXIS_START_ID());
- AttributePtr aEndAttr = anEllipse->attribute(SketchPlugin_Ellipse::MAJOR_AXIS_END_ID());
- anEntities.push_back(createAxis(aSketch, aStartAttr, aEndAttr, majorAxis));
+ anEntities.push_back(createAxis(aSketch, anEllipse, SketchPlugin_Ellipse::MAJOR_AXIS_START_ID(),
+ SketchPlugin_Ellipse::MAJOR_AXIS_END_ID(), majorAxis));
}
if (!minorAxis.empty()) {
- AttributePtr aStartAttr = anEllipse->attribute(SketchPlugin_Ellipse::MINOR_AXIS_START_ID());
- AttributePtr aEndAttr = anEllipse->attribute(SketchPlugin_Ellipse::MINOR_AXIS_END_ID());
- anEntities.push_back(createAxis(aSketch, aStartAttr, aEndAttr, minorAxis));
+ anEntities.push_back(createAxis(aSketch, anEllipse, SketchPlugin_Ellipse::MINOR_AXIS_START_ID(),
+ SketchPlugin_Ellipse::MINOR_AXIS_END_ID(), minorAxis));
}
return SketchAPI_SketchEntity::wrap(anEntities);
TestProjectionIntoResult.py
TestProjectionUpdate.py
TestRectangle.py
+ TestRemoveEllipse.py
TestRemoveSketch.py
TestSignedDistancePointLine.py
TestSignedDistancePointPoint.py
/// new attributes should be added to end of the feature in order to provide
/// correct attribute values in previous saved studies
data()->addAttribute(LENGTH_ID(), ModelAPI_AttributeDouble::typeId());
+
+ data()->addAttribute(PARENT_ID(), ModelAPI_AttributeReference::typeId());
+ ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), PARENT_ID());
}
void SketchPlugin_Line::initDerivedClassAttributes()
return MY_LENGTH;
}
+ /// Reference to the parent feature
+ inline static const std::string& PARENT_ID()
+ {
+ static const std::string& MY_PARENT_ID("ParentFeature");
+ return MY_PARENT_ID;
+ }
+
/// Returns the kind of a feature
SKETCHPLUGIN_EXPORT virtual const std::string& getKind();
aEllipseFeature->execute();
// create auxiliary points
- createAuxiliaryPoint(aEllipseFeature->attribute(SketchPlugin_Ellipse::CENTER_ID()));
- createAuxiliaryPoint(aEllipseFeature->attribute(SketchPlugin_Ellipse::FIRST_FOCUS_ID()));
- createAuxiliaryPoint(aEllipseFeature->attribute(SketchPlugin_Ellipse::SECOND_FOCUS_ID()));
- createAuxiliaryPoint(aEllipseFeature->attribute(SketchPlugin_Ellipse::MAJOR_AXIS_START_ID()));
- createAuxiliaryPoint(aEllipseFeature->attribute(SketchPlugin_Ellipse::MAJOR_AXIS_END_ID()));
- createAuxiliaryPoint(aEllipseFeature->attribute(SketchPlugin_Ellipse::MINOR_AXIS_START_ID()));
- createAuxiliaryPoint(aEllipseFeature->attribute(SketchPlugin_Ellipse::MINOR_AXIS_END_ID()));
+ createAuxiliaryPoint(aEllipseFeature, SketchPlugin_Ellipse::CENTER_ID());
+ createAuxiliaryPoint(aEllipseFeature, SketchPlugin_Ellipse::FIRST_FOCUS_ID());
+ createAuxiliaryPoint(aEllipseFeature, SketchPlugin_Ellipse::SECOND_FOCUS_ID());
+ createAuxiliaryPoint(aEllipseFeature, SketchPlugin_Ellipse::MAJOR_AXIS_START_ID());
+ createAuxiliaryPoint(aEllipseFeature, SketchPlugin_Ellipse::MAJOR_AXIS_END_ID());
+ createAuxiliaryPoint(aEllipseFeature, SketchPlugin_Ellipse::MINOR_AXIS_START_ID());
+ createAuxiliaryPoint(aEllipseFeature, SketchPlugin_Ellipse::MINOR_AXIS_END_ID());
// create auxiliary axes
- createAuxiliaryAxis(aEllipseFeature->attribute(SketchPlugin_Ellipse::MAJOR_AXIS_START_ID()),
- aEllipseFeature->attribute(SketchPlugin_Ellipse::MAJOR_AXIS_END_ID()));
- createAuxiliaryAxis(aEllipseFeature->attribute(SketchPlugin_Ellipse::MINOR_AXIS_START_ID()),
- aEllipseFeature->attribute(SketchPlugin_Ellipse::MINOR_AXIS_END_ID()));
+ createAuxiliaryAxis(aEllipseFeature,
+ SketchPlugin_Ellipse::MAJOR_AXIS_START_ID(),
+ SketchPlugin_Ellipse::MAJOR_AXIS_END_ID());
+ createAuxiliaryAxis(aEllipseFeature,
+ SketchPlugin_Ellipse::MINOR_AXIS_START_ID(),
+ SketchPlugin_Ellipse::MINOR_AXIS_END_ID());
return aEllipseFeature;
}
-void SketchPlugin_MacroEllipse::createAuxiliaryPoint(const AttributePtr& theEllipsePoint)
+void SketchPlugin_MacroEllipse::createAuxiliaryPoint(const FeaturePtr& theEllipseFeature,
+ const std::string& theEllipsePoint)
{
FeaturePtr aPointFeature = sketch()->addFeature(SketchPlugin_Point::ID());
aPointFeature->boolean(SketchPlugin_Point::AUXILIARY_ID())->setValue(true);
+ aPointFeature->reference(SketchPlugin_Point::PARENT_ID())->setValue(theEllipseFeature);
- AttributePoint2DPtr anElPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(theEllipsePoint);
+ AttributePoint2DPtr anElPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ theEllipseFeature->attribute(theEllipsePoint));
AttributePoint2DPtr aCoord = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
aPointFeature->attribute(SketchPlugin_Point::COORD_ID()));
aCoord->setValue(anElPoint->x(), anElPoint->y());
+ aPointFeature->execute();
+ std::string aName = theEllipseFeature->name() + "_" + theEllipsePoint;
+ aPointFeature->data()->setName(aName);
+ aPointFeature->lastResult()->data()->setName(aName);
+
createInternalConstraint(anElPoint, aCoord);
}
-void SketchPlugin_MacroEllipse::createAuxiliaryAxis(const AttributePtr& theStartPoint,
- const AttributePtr& theEndPoint)
+void SketchPlugin_MacroEllipse::createAuxiliaryAxis(const FeaturePtr& theEllipseFeature,
+ const std::string& theStartPoint,
+ const std::string& theEndPoint)
{
FeaturePtr aLineFeature = sketch()->addFeature(SketchPlugin_Line::ID());
aLineFeature->boolean(SketchPlugin_Point::AUXILIARY_ID())->setValue(true);
+ aLineFeature->reference(SketchPlugin_Point::PARENT_ID())->setValue(theEllipseFeature);
- AttributePoint2DPtr aStartPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(theStartPoint);
- AttributePoint2DPtr aEndPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(theEndPoint);
+ AttributePoint2DPtr aStartPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ theEllipseFeature->attribute(theStartPoint));
+ AttributePoint2DPtr aEndPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ theEllipseFeature->attribute(theEndPoint));
AttributePoint2DPtr aLineStart = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
aLineFeature->attribute(SketchPlugin_Line::START_ID()));
aLineFeature->attribute(SketchPlugin_Line::END_ID()));
aLineEnd->setValue(aEndPoint->x(), aEndPoint->y());
+ aLineFeature->execute();
+ std::string aName = theEllipseFeature->name() + "_" +
+ (theStartPoint == SketchPlugin_Ellipse::MAJOR_AXIS_START_ID() ? "major_axis" : "minor_axis");
+ aLineFeature->data()->setName(aName);
+ aLineFeature->lastResult()->data()->setName(aName);
+
createInternalConstraint(aStartPoint, aLineStart);
createInternalConstraint(aEndPoint, aLineEnd);
}
FeaturePtr createEllipseFeature();
- void createAuxiliaryPoint(const AttributePtr& theEllipsePoint);
- void createAuxiliaryAxis(const AttributePtr& theStartPoint, const AttributePtr& theEndPoint);
+ void createAuxiliaryPoint(const FeaturePtr& theEllipseFeature,
+ const std::string& theEllipsePoint);
+ void createAuxiliaryAxis(const FeaturePtr& theEllipseFeature,
+ const std::string& theStartPoint,
+ const std::string& theEndPoint);
void createInternalConstraint(const AttributePtr& thePoint1, const AttributePtr& thePoint2);
#include <ModelAPI_Data.h>
#include <ModelAPI_ResultConstruction.h>
+#include <ModelAPI_AttributeReference.h>
#include <ModelAPI_AttributeSelection.h>
#include <ModelAPI_Validator.h>
#include <ModelAPI_Session.h>
data()->addAttribute(SketchPlugin_Point::COORD_ID(), GeomDataAPI_Point2D::typeId());
data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::typeId());
ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), EXTERNAL_ID());
+
+ data()->addAttribute(PARENT_ID(), ModelAPI_AttributeReference::typeId());
+ ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), PARENT_ID());
}
void SketchPlugin_Point::execute()
static const std::string MY_COORD_ID("PointCoordinates");
return MY_COORD_ID;
}
+ /// Reference to the parent feature
+ inline static const std::string& PARENT_ID()
+ {
+ static const std::string& MY_PARENT_ID("ParentFeature");
+ return MY_PARENT_ID;
+ }
/// Returns the kind of a feature
SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
{
--- /dev/null
+# Copyright (C) 2019 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+"""
+ Test removing ellipse and its construstion elements
+"""
+
+from salome.shaper import model
+from ModelAPI import *
+
+def assertNbSubs(theSketch, theNbPoints, theNbLines, theNbEllipses, theNbInternalConstraints):
+ model.testNbSubFeatures(theSketch, "SketchPoint", theNbPoints)
+ model.testNbSubFeatures(theSketch, "SketchLine", theNbLines)
+ model.testNbSubFeatures(theSketch, "SketchEllipse", theNbEllipses)
+ model.testNbSubFeatures(theSketch, "SketchConstraintCoincidenceInternal", theNbInternalConstraints)
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchEllipse_1 = Sketch_1.addEllipse(40, 30, 70, 40, 20)
+[Center, Focus1, Focus2, MajorAxisStart, MajorAxisEnd, MinorAxisStart, MinorAxisEnd, MajorAxisLine, MinorAxisLine] = SketchEllipse_1.construction(center = "aux", firstFocus = "aux", secondFocus = "aux", majorAxisStart = "aux", majorAxisEnd = "aux", minorAxisStart = "aux", minorAxisEnd = "aux", majorAxis = "aux", minorAxis = "aux")
+model.do()
+model.end()
+
+DEFAULT_DOF = 5
+DEFAULT_POINTS = 7
+DEFAULT_LINES = 2
+DEFAULT_ELLIPSES = 1
+DEAFULT_INTERNALS = 11
+
+assertNbSubs(Sketch_1, DEFAULT_POINTS, DEFAULT_LINES, DEFAULT_ELLIPSES, DEAFULT_INTERNALS)
+assert(model.dof(Sketch_1) == DEFAULT_DOF)
+
+# Test 1. Remove auxiliary points one by one.
+points = [Center, Focus1, Focus2, MajorAxisStart, MajorAxisEnd, MinorAxisStart, MinorAxisEnd]
+for pnt in points:
+ model.begin()
+ removeFeaturesAndReferences(FeatureSet([pnt.feature()]))
+ model.end()
+
+ assertNbSubs(Sketch_1, DEFAULT_POINTS - 1, DEFAULT_LINES, DEFAULT_ELLIPSES, DEAFULT_INTERNALS - 1)
+ assert(model.dof(Sketch_1) == DEFAULT_DOF)
+ model.undo()
+ assertNbSubs(Sketch_1, DEFAULT_POINTS, DEFAULT_LINES, DEFAULT_ELLIPSES, DEAFULT_INTERNALS)
+ assert(model.dof(Sketch_1) == DEFAULT_DOF)
+
+# Test 2. Remove auxiliary axes one by one.
+lines = [MajorAxisLine, MinorAxisLine]
+for ln in lines:
+ model.begin()
+ removeFeaturesAndReferences(FeatureSet([ln.feature()]))
+ model.end()
+
+ assertNbSubs(Sketch_1, DEFAULT_POINTS, DEFAULT_LINES - 1, DEFAULT_ELLIPSES, DEAFULT_INTERNALS - 2)
+ assert(model.dof(Sketch_1) == DEFAULT_DOF)
+ model.undo()
+ assertNbSubs(Sketch_1, DEFAULT_POINTS, DEFAULT_LINES, DEFAULT_ELLIPSES, DEAFULT_INTERNALS)
+ assert(model.dof(Sketch_1) == DEFAULT_DOF)
+
+# Test 3. Remove the ellipse.
+model.begin()
+removeFeaturesAndReferences(FeatureSet([SketchEllipse_1.feature()]))
+model.end()
+
+assertNbSubs(Sketch_1, 0, 0, 0, 0)
+assert(model.dof(Sketch_1) == 0)
+model.undo()
+assertNbSubs(Sketch_1, DEFAULT_POINTS, DEFAULT_LINES, DEFAULT_ELLIPSES, DEAFULT_INTERNALS)
+assert(model.dof(Sketch_1) == DEFAULT_DOF)
+
+# Test 4. Remove some construction elements, make non-auxiliary a couple of the rest and check the dumping.
+model.begin()
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchEllipse_2 = Sketch_2.addEllipse(40, -30, 70, 0, 10)
+[Center, Focus1, Focus2, MajorAxisStart, MajorAxisEnd, MinorAxisStart, MinorAxisEnd, MajorAxisLine, MinorAxisLine] = SketchEllipse_2.construction(center = "aux", firstFocus = "aux", secondFocus = "aux", majorAxisStart = "aux", majorAxisEnd = "aux", minorAxisStart = "aux", minorAxisEnd = "aux", majorAxis = "aux", minorAxis = "aux")
+model.do()
+model.end()
+
+model.begin()
+removeFeaturesAndReferences(FeatureSet([MajorAxisLine.feature(), Focus2.feature()]))
+Focus1.setAuxiliary(False)
+MinorAxisEnd.setAuxiliary(False)
+model.end()
+
+assertNbSubs(Sketch_2, DEFAULT_POINTS - 1, DEFAULT_LINES - 1, DEFAULT_ELLIPSES, DEAFULT_INTERNALS - 3)
+assert(model.dof(Sketch_2) == DEFAULT_DOF)
+
+assert(model.checkPythonDump())