Merge pull request #23164 from ickby/FEM_post_fixes_4
Fem: Fix for 3 issues
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user