Core: GeoFeature: Add python binding to the new getGlobalPlacement()

This commit is contained in:
PaddleStroke
2024-09-30 10:45:22 +02:00
committed by Chris Hennes
parent 141a627b8f
commit 306183ce26
3 changed files with 40 additions and 1 deletions

View File

@@ -57,6 +57,27 @@ PyObject* GeoFeaturePy::getGlobalPlacement(PyObject * args) {
}
}
PyObject* GeoFeaturePy::getGlobalPlacementOf(PyObject * args) {
PyObject* pyTargetObj;
PyObject* pyRootObj;
char* pname;
if (!PyArg_ParseTuple(args, "OOs", &pyTargetObj, &pyRootObj, &pname)) {
return nullptr;
}
auto* targetObj = static_cast<App::DocumentObjectPy*>(pyTargetObj)->getDocumentObjectPtr();
auto* rootObj = static_cast<App::DocumentObjectPy*>(pyRootObj)->getDocumentObjectPtr();
try {
Base::Placement p = GeoFeature::getGlobalPlacement(targetObj, rootObj, pname);
return new Base::PlacementPy(new Base::Placement(p));
}
catch (const Base::Exception& e) {
throw Py::RuntimeError(e.what());
}
}
PyObject* GeoFeaturePy::getPropertyNameOfGeometry(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))