question

Pinakin K avatar image
1 Like"
Pinakin K asked Matthew Gillespie commented

How do i get the group from an object?

I want to return the group the object is in. I have a lot of groups so to use the "is member" command is my last option. But is there any other way to return the group the object is in?

FlexSim 21.1.2
groupsgroupfromobject
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Claire Krupp avatar image
5 Likes"
Claire Krupp answered Matthew Gillespie commented

Hi Pinakin, hope you are doing well!

this worked for me:

Variant myGroups = myObj.getProperty("Groups");

It gives you an array with the names of each group the object is in.


· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

Additionally, the AllGroups property will return an array of all the groups that the object is in directly and indirectly. If you aren't using nested groups then Groups and AllGroups will return the same thing. See this question for more details, Property Tables columns "Groups" vs "AllGroups"

2 Likes 2 ·
Pinakin K avatar image Pinakin K commented ·

Awesome! This works perfectly!

Thank You!

1 Like 1 ·