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

This commit is contained in:
PaddleStroke
2024-05-10 11:26:33 +02:00
committed by Yorik van Havre
parent 7096125038
commit 5f4dd814ea
8 changed files with 51 additions and 5 deletions

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());