Sketcher: Python command to delete all internal geometry and constraints of an sketch

This commit is contained in:
Abdullah Tahiri
2017-11-05 07:29:19 +01:00
committed by wmayer
parent 7f5e0caf3e
commit 3aec9b3859
4 changed files with 41 additions and 0 deletions

View File

@@ -722,6 +722,23 @@ int SketchObject::delGeometry(int GeoId, bool deleteinternalgeo)
return 0;
}
int SketchObject::deleteAllGeometry()
{
std::vector< Part::Geometry * > newVals(0);
std::vector< Constraint * > newConstraints(0);
this->Geometry.setValues(newVals);
this->Constraints.setValues(newConstraints);
this->Constraints.acceptGeometry(getCompleteGeometry());
rebuildVertexIndex();
if(noRecomputes) // if we do not have a recompute, the sketch must be solved to update the DoF of the solver
solve();
return 0;
}
int SketchObject::toggleConstruction(int GeoId)
{
const std::vector< Part::Geometry * > &vals = getInternalGeometry();