Merge pull request #23164 from ickby/FEM_post_fixes_4

Fem: Fix for 3 issues
This commit is contained in:
Chris Hennes
2025-08-19 19:00:55 -05:00
committed by GitHub
9 changed files with 87 additions and 17 deletions

View File

@@ -61,6 +61,13 @@ class GroupExtension(DocumentObjectExtension):
"""
...
def getObjectsOfType(self, typename: str) -> List[Any]:
"""
Returns all object in the group of given type
@param typename The Freecad type identifier
"""
...
def hasObject(self, obj: Any, recursive: bool = False) -> bool:
"""
hasObject(obj, recursive=false)

View File

@@ -278,6 +278,22 @@ PyObject* GroupExtensionPy::getObject(PyObject* args)
}
}
PyObject* GroupExtensionPy::getObjectsOfType(PyObject* args)
{
char* pcName;
if (!PyArg_ParseTuple(args, "s", &pcName)) {
return nullptr;
}
std::vector<DocumentObject*> objs = getGroupExtensionPtr()->getObjectsOfType(Base::Type::fromName(pcName));
Py::List result;
for (App::DocumentObject* obj : objs) {
result.append(Py::asObject(obj->getPyObject()));
}
return Py::new_reference_to(result);
}
PyObject* GroupExtensionPy::hasObject(PyObject* args)
{
PyObject* object;