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:
PaddleStroke
2025-10-14 11:40:10 +02:00
committed by GitHub
parent c55e1c3bba
commit a0c28aba75
4 changed files with 24 additions and 1 deletions

View File

@@ -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
}