Notifications
Clear all

[Closed] how get object group Head

how get object group Head?

2 Replies

Use

isGroupHead yourNode --where yourNode is a valid object node

Please refer to docs first before u post your question here.

Thanks
Mobeen

1 Reply
(@j-man)
Joined: 11 months ago

Posts: 0

Hmmm, Im not sure this is correct.

The method isgrouphead will tell you if a node is a group head, but it wont tell what that objects group head is.
You may notice that objects can either be part of a group, or be parented by linking to another object, but not both. Interestingly, and object can be parented to another object of the same group.

$myobjext.parent will return either the parent of an object, or the header of a group. so, we can build a recursive function to search though an objects parents so see which one is a group head.

fn findhead s=if isgrouphead s[1] then return s[1] else if isgroupmember s[1] then findhead #(s[1].parent) else return undefined

I’m sure there are other ways to do this.

J.