diff --git a/src/App/DocumentPy.xml b/src/App/DocumentPy.xml
index c43726622c..2e929d7ac1 100644
--- a/src/App/DocumentPy.xml
+++ b/src/App/DocumentPy.xml
@@ -56,6 +56,18 @@ For a temporary document it returns its transient directory.
+
+
+ getUniqueObjectName(objName) -> objName
+
+ Return the same name, or the name made unique, for Example Box -> Box002 if there are conflicting name
+ already in the document.
+
+ ObjName : str
+ Object name.
+
+
+
Merges this document with another project file
diff --git a/src/App/DocumentPyImp.cpp b/src/App/DocumentPyImp.cpp
index c9beed7a99..229ba5d7d7 100644
--- a/src/App/DocumentPyImp.cpp
+++ b/src/App/DocumentPyImp.cpp
@@ -217,6 +217,18 @@ PyObject* DocumentPy::getFileName(PyObject* args)
return Py::new_reference_to(Py::String(fn));
}
+PyObject* DocumentPy::getUniqueObjectName(PyObject *args)
+{
+ char *sName;
+ if (!PyArg_ParseTuple(args, "s", &sName))
+ return nullptr;
+ PY_TRY {
+ auto newName = getDocumentPtr()->getUniqueObjectName(sName);
+ return Py::new_reference_to(Py::String(newName));
+ }
+ PY_CATCH;
+}
+
PyObject* DocumentPy::mergeProject(PyObject * args)
{
char* filename;
diff --git a/src/App/GeoFeature.cpp b/src/App/GeoFeature.cpp
index 2ec1640ee6..e3f448fac9 100644
--- a/src/App/GeoFeature.cpp
+++ b/src/App/GeoFeature.cpp
@@ -159,7 +159,7 @@ DocumentObject *GeoFeature::resolveElement(DocumentObject *obj, const char *subn
}
if(geoFeature)
*geoFeature = geo;
- if(!obj || (filter && geo!=filter))
+ if(filter && geo!=filter)
return nullptr;
if(!element || !element[0]) {
if(append)
diff --git a/src/Gui/Application.h b/src/Gui/Application.h
index 64d768b054..74f5056e88 100644
--- a/src/Gui/Application.h
+++ b/src/Gui/Application.h
@@ -28,8 +28,6 @@
#include