All group members


#21

in my case, I need only objects, not grouphead, but if it’s needed then just exclude

and (not isgrouphead s)


#22

Denis, for my situation, I need all members from inside last closed top group, that’s why

print (getClRootGroupHead g2)
is giving $Dummy:g5 and it’s selecting members of g5 as well.


#23

the situation might change some day :wink: it’s always good to have a universal solution.

fn isGroupHeadMember head node act:off = 
(
	while isvalidnode node and isgroupmember node and not (act = (node.parent == head)) do node = node.parent
	act
)
fn getAllGroupMembers head = if isgrouphead head do
(
	for node in (join #() head) where isGroupHeadMember head node collect node
)
select (getAllGroupMembers $g2)

#24

So short, and so NICE!
Thank you, Denis! This is really useful!