Merge pull request #14934 from Ondsel-Development/asm_insert_asm

Assembly: Insert Component: Fix assembly not appearing
This commit is contained in:
Chris Hennes
2024-06-25 11:03:16 -05:00
committed by GitHub
5 changed files with 49 additions and 5 deletions

View File

@@ -165,7 +165,7 @@ class TaskAssemblyInsertLink(QtCore.QObject):
def process_objects(objs, item):
onlyParts = self.form.CheckBox_ShowOnlyParts.isChecked()
for obj in objs:
if obj.Name == self.assembly.Name:
if obj == self.assembly:
continue # Skip current assembly
if (
@@ -180,7 +180,7 @@ class TaskAssemblyInsertLink(QtCore.QObject):
(not onlyParts and child.isDerivedFrom("Part::Feature"))
or child.isDerivedFrom("App::Part")
)
for child in obj.OutListRecursive
for child in obj.ViewObject.claimChildrenRecursive()
):
continue # Skip this object if no relevant children
@@ -201,7 +201,7 @@ class TaskAssemblyInsertLink(QtCore.QObject):
if obj.isDerivedFrom("App::Part") or obj.isDerivedFrom(
"App::DocumentObjectGroup"
):
process_objects(obj.OutList, objItem)
process_objects(obj.ViewObject.claimChildren(), objItem)
guiDoc = Gui.getDocument(doc.Name)
process_objects(guiDoc.TreeRootObjects, docItem)