question

Kaspar Chabot avatar image
0 Likes"
Kaspar Chabot asked Joerg Vogel commented

Sending a message to all group members

Hi,

I am trying to simulate a half-hour break in the manufacturing process upstream to the process I am modeling. In order to achieve this, I am closing the inputs on a total of 5 sources, which I put in a group for the sake of copying triggers easily.

Of course, I could send a message to all of these sources separately, but I was wondering if there is an easy way to send a message to every group member, such as a for loop. This would really save a lot of time if I was dealing with groups of tens of hundreds of objects.

Many thanks in advance.

Regards,

Kaspar

FlexSim 16.2.1
groupsmessagescloseinputsendmember
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

·
Steven Hamoen avatar image
1 Like"
Steven Hamoen answered Joerg Vogel commented

@Kaspar Chabot You can use the group commands to do this. As an example:

for( int i =1; i<= groupnummembers("Group1") ; i++) 

{  

	senddelayedmessage( groupmember("Group1", i), 0, model() ); 

}
· 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.

Kaspar Chabot avatar image Kaspar Chabot commented ·

Thank you! I don't have that much experience working with groups so far, and I didn't know about the groupmembers command. Seems really useful!

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Kaspar Chabot commented ·

@Kaspar Chabot If you open any index of the command reference in the manual direct in Flexsim you can search the index by a keyword. Move your mouse pointer in the index, then you activate the widget by pressing simply the left mouse button. After that you activate the search shortcut ctrl+f. You put in the mask your keyword inside the field 'Find What' and press find next. The function names contains often a hint what they are for.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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