hi,
I am looking for as how to delete empty groups and subgroups with the database?
Would be great if you share a code snippet.
Many thanks..
Saniya
hi,
I am looking for as how to delete empty groups and subgroups with the database?
Would be great if you share a code snippet.
Many thanks..
Saniya
Hi Saniya,
you will have to handle all groups recursively and check for all 3 element types which can be contained in a group:
var subgroups = group.Childs()
var models = group.ModelList(false)
var objs = group.ObjDefList(false)
If all lists are empty, the group can be deleted (via its parent: group.Parent().Delete(group)
This requires first to step down the group tree recursively until a group has no subgroups, delete if empty and then continue (one step backward) at the deleted group's parent.
BR, Torsten