Core: Add getRootObjectsIgnoreLinks and fix bugs in tree.cpp and AssemblyObject.cpp, CommandInsertLink.py, UtilsAssembly.py

This commit is contained in:
PaddleStroke
2024-05-13 17:58:34 +02:00
committed by Yorik van Havre
parent 4cd8b2ad15
commit 344b125a07
8 changed files with 51 additions and 5 deletions
+12
View File
@@ -746,6 +746,18 @@ Py::List DocumentPy::getRootObjects() const
return res;
}
Py::List DocumentPy::getRootObjectsIgnoreLinks() const
{
std::vector<App::DocumentObject*> objs = getDocumentPtr()->getRootObjectsIgnoreLinks();
Py::List res;
for (auto obj : objs)
//Note: Here we must force the Py::Object to own this Python object as getPyObject() increments the counter
res.append(Py::Object(obj->getPyObject(), true));
return res;
}
Py::Int DocumentPy::getUndoMode() const
{
return Py::Int(getDocumentPtr()->getUndoMode());