question

Javier PL avatar image
0 Likes"
Javier PL asked Javier PL commented

Is it possible to set the same trigger for multiple objects at once?

I have multiple operators to which I would like to configure the same trigger "OnReset" (same Custom Code in my case). Is it possible to do it all at once like with labels or other common parameters?

Regards,


Javi

FlexSim 19.0.0
operatorstriggersparameters
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 Javier PL commented

@Javier PL I would create a usercommand with the code you want to execute on Reset. That way you have only 1 place to change or debug code.

Then you put the code on 1 operator (and test it first of course ;-)) and select all the other operators, highlight the operator with the correct code and copy the resettrigger use the "Edit Selected Objects" panel. (you first have to create the resettrigger on the trigger tabpage, otherwise it won't show up in this list)


· 3
5 |100000

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

Javier PL avatar image Javier PL commented ·

In principle this solves my problem! It's a pity that "onStateChange" trigger does not show up although it's already created...I guess in that case the only solution would be to set the trigger via script (e.g. put all the operators in a group and loop through it)

0 Likes 0 ·
Steven Hamoen avatar image Steven Hamoen Javier PL commented ·

@Javier PL

yes the onstatechange is something special. It is not a variable but an eventfunction. If you look at the tree, you will see that you find that node under behaviour -> eventfunctions->OnStateChange

So indeed you have to create your own script to copy those.


1 Like 1 ·
Javier PL avatar image Javier PL Steven Hamoen commented ·

Thanks!

0 Likes 0 ·