Assembly: Fix lengths cannot be negative (#24625)
* Assembly: Fix lengths cannot be negative * Update PropertyUnits.cpp * Update PropertyUnits.h * Update JointObject.py
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
#include <boost/iostreams/device/array.hpp>
|
||||
#include <boost/iostreams/stream.hpp>
|
||||
|
||||
#include "PropertyUnits.h"
|
||||
|
||||
// inclusion of the generated files (generated out of PropertyContainerPy.xml)
|
||||
#include "PropertyContainerPy.h"
|
||||
#include "PropertyContainerPy.cpp"
|
||||
@@ -272,6 +274,12 @@ PyObject* PropertyContainerPy::setPropertyStatus(PyObject* args)
|
||||
continue;
|
||||
}
|
||||
|
||||
auto lengthProp = freecad_cast<App::PropertyLength*>(prop);
|
||||
if (lengthProp && v == "AllowNegativeValues") {
|
||||
lengthProp->enableNegative(value);
|
||||
continue;
|
||||
}
|
||||
|
||||
PyErr_Format(PyExc_ValueError, "Unknown property status '%s'", v.c_str());
|
||||
return nullptr;
|
||||
}
|
||||
@@ -721,3 +729,4 @@ PyObject* PropertyContainerPy::renameProperty(PyObject* args) const
|
||||
}
|
||||
PY_CATCH
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user