+ revert to previous values when setDatum fails

+ detect well known invalid values for setDatum
+ hide some negative distance datums in the gui


git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5133 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
logari81
2011-11-14 18:45:59 +00:00
parent 8c65bec480
commit 85b2fec8f6
5 changed files with 52 additions and 21 deletions

View File

@@ -198,6 +198,10 @@ PyObject* SketchObjectPy::setDatum(PyObject *args)
str << "Cannot set the datum because the sketch contains conflicting constraints";
else if (err == -2)
str << "Datum " << Datum << " for the constraint with index " << Index << " is invalid";
else if (err == -4)
str << "Negative datum values are not valid for the constraint with index " << Index;
else if (err == -5)
str << "Zero is not a valid datum for the constraint with index " << Index;
else
str << "Unexpected problem at setting datum " << Datum << " for the constraint with index " << Index;
PyErr_SetString(PyExc_ValueError, str.str().c_str());