listen Events and Execute custom code by code

listen Events and Execute custom code by code

565109852
Contributor Contributor
15 Views
6 Replies
Message 1 of 7

listen Events and Execute custom code by code

565109852
Contributor
Contributor

[ FlexSim 21.0.2 ]

How to listen to Object binded but not added trigger through code (NOT PF)? For example, When the item entering in Queue1, I want to execute the variable code (queueOnEntry) of Plane1.

I added an eventListener ,but it does not worked.

Any suggestion is welcome.

38281-pic1.png

listen Events and Execute custom codeV21.0.2.fsm

0 Likes
Accepted solutions (1)
16 Views
6 Replies
Replies (6)
Message 2 of 7

565109852
Contributor
Contributor

Prompt reply. @jason.lightfoot @steven.hamoen @Matthew Gillespie @Ben Wilson

I know that message triggering can be realized, and so can PF. It's just that I'm doing a function development. Should I consider triggers function overload and how to implement it?

Be grateful.

0 Likes
Message 3 of 7

joerg_vogel_HsH
Mentor
Mentor

then try the SDK

0 Likes
Message 4 of 7

565109852
Contributor
Contributor

Can the function eventlisten be implemented? It seems that the third parameter of this function named relaynode is not executed.

0 Likes
Message 5 of 7

565109852
Contributor
Contributor

It Worked.

Message 6 of 7

philboboADSK
Autodesk
Autodesk
Accepted solution

The problem with your model is that your plane reference is wrong. You are trying to reference "Plane24", but the object in your model is "Plane1".

Also, your queueOnEntry node needs to be toggled as FlexScript. Right now, it is just holding a string. Since you want it to be executed, you need to toggle it as FlexScript.

Attached is your example, modified to show you how the eventlisten() command works.

listen-events-and-execute-custom-codev2102_1.fsm

38351-1617895701322.png



Phil BoBo
Sr. Manager, Software Development
Message 7 of 7

565109852
Contributor
Contributor

The Object name was not changed back when uploading. The main problem is the node data type.Thank you very much.

0 Likes