question

Eric C2 avatar image
0 Likes"
Eric C2 asked Eric C2 answered

trigger itemtype

How can I assign a trigger for an itemtype.

What I have to write in the circled box for example to generate a trigger for the item Type 3.

Thank you in advance


FlexSim 21.0.1
triggersflexsim 21.0.1
itemtype.png (130.3 KiB)
· 1
5 |100000

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

Eric C2 avatar image Eric C2 commented ·

In fact, is not depending on the Type, it should be depending on the item lable called type with the value 3.

0 Likes 0 ·
José Antonio MD avatar image
1 Like"
José Antonio MD answered tannerp commented

Hello @Eric C2,

I can't see your image well. But you can add conditions for that: Open the code, and write if(....) else (...) , using a decide in ProcessFlow.

You can see something similar in the following image

I hope I have been helpfull .


1610719738645.png (17.0 KiB)
· 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.

Eric C2 avatar image Eric C2 commented ·

Hi Jose Antonio,

Thank you for your answer, but I want to know if I can indicate in the box called object, when you are setting a trigger, the item label type to indicate a trigger just for this elements.


Normally in this box is writed Item, but I want to know which is the code to indicate a specific item depending on its label called Type with the value 3.

Thank you.

0 Likes 0 ·
tannerp avatar image tannerp Eric C2 commented ·

@Eric C2,

In Jose's answer, he added an "IF" statement that allows you to specify the item Types for which the code should run. In other words, the setloc function will only run on an item if that item's Type label is equal to 3. Any items with different item Type labels will be passed over by the IF statement.

I assume you have many items with a Type label of 3. If that's the case, ALL of the items with a Type label of 3 will be affected by the setloc function.

If you only have one specific item that you'd like to manipulate, you need to create a pointer that is unique to that item. Otherwise, the function will be applied to any item with a Type label of 3.

Hope this explanation makes sense. Jose's answer should be exactly what you need. If you'd like help implementing his solution, please attach a model and we'd be happy to help.

0 Likes 0 ·
Eric C2 avatar image
0 Likes"
Eric C2 answered

Thank you both, with your comment my problem was solved.

5 |100000

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

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.