Core: Add Gui::Document::getTreeRootObjects()

This commit is contained in:
PaddleStroke
2024-05-30 12:20:35 +02:00
parent 238fd6a5fc
commit fb32579498
7 changed files with 57 additions and 3 deletions

View File

@@ -203,7 +203,8 @@ class TaskAssemblyInsertLink(QtCore.QObject):
):
process_objects(obj.OutList, objItem)
process_objects(doc.RootObjectsIgnoreLinks, docItem)
guiDoc = Gui.getDocument(doc.Name)
process_objects(guiDoc.TreeRootObjects, docItem)
self.form.partList.expandAll()
def onFilterChange(self):

View File

@@ -308,7 +308,7 @@ def getGlobalPlacement(targetObj, container=None):
def isThereOneRootAssembly():
for part in App.activeDocument().RootObjectsIgnoreLinks:
for part in Gui.activeDocument().TreeRootObjects:
if part.TypeId == "Assembly::AssemblyObject":
return True
return False