Core: GeoFeature: Add python binding to the new getGlobalPlacement()
This commit is contained in:
committed by
Chris Hennes
parent
141a627b8f
commit
306183ce26
@@ -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, ""))
|
||||
|
||||
Reference in New Issue
Block a user