Draft: fix autogroup behavior if active group is a layer (#27102)

This commit is contained in:
Roy-043
2026-01-29 15:38:55 +01:00
committed by GitHub
parent 00c3422c1f
commit 0f2bdf280f

View File

@@ -128,13 +128,22 @@ def autogroup(obj):
if active_group is None:
# Layer/group does not exist (anymore)
Gui.draftToolBar.setAutoGroup() # Change active layer/group in Tray to None.
elif utils.get_type(active_group) == "Layer":
if not obj in active_group.Group:
active_group.Group += [obj]
# No return statement here as objects can be in a layer and in
# a normal group or group-like BIM object at the same time.
elif obj in active_group.InListRecursive:
return
if obj in active_group.InListRecursive:
else:
if not obj in active_group.Group:
if hasattr(active_group, "addObject"):
active_group.addObject(obj)
else:
active_group.Group += [obj]
return
if not obj in active_group.Group:
active_group.Group += [obj]
elif Gui.ActiveDocument.ActiveView.getActiveObject("NativeIFC") is not None:
if Gui.ActiveDocument.ActiveView.getActiveObject("NativeIFC") is not None:
# NativeIFC handling
try:
from nativeifc import ifc_tools