diff --git a/src/App/GeoFeatureGroupExtension.cpp b/src/App/GeoFeatureGroupExtension.cpp
index 68d1ba2fa2..ec45732545 100644
--- a/src/App/GeoFeatureGroupExtension.cpp
+++ b/src/App/GeoFeatureGroupExtension.cpp
@@ -112,6 +112,9 @@ DocumentObject* GeoFeatureGroupExtension::getGroupOfObject(const DocumentObject*
Base::Placement GeoFeatureGroupExtension::globalGroupPlacement() {
+ if(getExtendedObject()->isRecomputing())
+ throw Base::Exception("Global placement cannot be calculated on recompute");
+
return recursiveGroupPlacement(this);
}
diff --git a/src/App/GeoFeaturePy.xml b/src/App/GeoFeaturePy.xml
index d2f165ce2a..5ded4b50b7 100644
--- a/src/App/GeoFeaturePy.xml
+++ b/src/App/GeoFeaturePy.xml
@@ -18,6 +18,13 @@
returns all possible paths to the root of the document
+
+
+ Returns the placement of the object in the global coordinate space, respecting all stacked relationships.
+ Note: This function is not available during recompute, as there the placements of parents can change
+ after the execution of this object, rendering the result wrong.
+
+
Returns the property name of the actual geometry or None.
diff --git a/src/App/GeoFeaturePyImp.cpp b/src/App/GeoFeaturePyImp.cpp
index 9eee2ea815..d95ea35a90 100644
--- a/src/App/GeoFeaturePyImp.cpp
+++ b/src/App/GeoFeaturePyImp.cpp
@@ -28,6 +28,7 @@
// inclusion of the generated files (generated out of GeoFeaturePy.xml)
#include "GeoFeaturePy.h"
#include "GeoFeaturePy.cpp"
+#include
#include
using namespace App;
@@ -44,6 +45,20 @@ PyObject* GeoFeaturePy::getPaths(PyObject * /*args*/)
return 0;
}
+PyObject* GeoFeaturePy::getGlobalPlacement(PyObject * args) {
+
+ if (!PyArg_ParseTuple(args, ""))
+ return 0;
+
+ try {
+ Base::Placement p = static_cast(getDocumentObjectPtr())->globalPlacement();
+ 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, ""))