Core: Add getRootObjectsIgnoreLinks and fix bugs in tree.cpp and AssemblyObject.cpp, CommandInsertLink.py, UtilsAssembly.py
This commit is contained in:
committed by
Yorik van Havre
parent
7096125038
commit
5f4dd814ea
@@ -2007,7 +2007,7 @@ Base::Placement AssemblyObject::getGlobalPlacement(App::DocumentObject* targetOb
|
||||
App::DocumentObject* container)
|
||||
{
|
||||
bool inContainerBranch = (container == nullptr);
|
||||
auto rootObjects = App::GetApplication().getActiveDocument()->getRootObjects();
|
||||
auto rootObjects = App::GetApplication().getActiveDocument()->getRootObjectsIgnoreLinks();
|
||||
for (auto& part : rootObjects) {
|
||||
Base::Placement foundPlc;
|
||||
bool found =
|
||||
|
||||
@@ -203,7 +203,7 @@ class TaskAssemblyInsertLink(QtCore.QObject):
|
||||
):
|
||||
process_objects(obj.OutList, objItem)
|
||||
|
||||
process_objects(doc.RootObjects, docItem)
|
||||
process_objects(doc.RootObjectsIgnoreLinks, docItem)
|
||||
self.form.partList.expandAll()
|
||||
|
||||
def onFilterChange(self):
|
||||
|
||||
@@ -297,7 +297,7 @@ def getGlobalPlacement(targetObj, container=None):
|
||||
return App.Placement()
|
||||
|
||||
inContainerBranch = container is None
|
||||
for rootObj in App.activeDocument().RootObjects:
|
||||
for rootObj in App.activeDocument().RootObjectsIgnoreLinks:
|
||||
foundPlacement = getTargetPlacementRelativeTo(
|
||||
targetObj, rootObj, container, inContainerBranch
|
||||
)
|
||||
@@ -308,7 +308,7 @@ def getGlobalPlacement(targetObj, container=None):
|
||||
|
||||
|
||||
def isThereOneRootAssembly():
|
||||
for part in App.activeDocument().RootObjects:
|
||||
for part in App.activeDocument().RootObjectsIgnoreLinks:
|
||||
if part.TypeId == "Assembly::AssemblyObject":
|
||||
return True
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user