question

Gui Vaccaro avatar image
0 Likes"
Gui Vaccaro asked Gui Vaccaro commented

Add OnDestroy to planes and task executors

Hello,

please see the attached example. Despite OnDestroy events have been added to all objects, when a plane is deleted, only the one added to the shape is executed. Is there a proper way to add OnDestroy events to the other objects, please?

OnDestroyExample.fsm

Thank you.

FlexSim 25.0.2
taskexecutorplaneondestroy
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

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Gui Vaccaro commented

In your OnDestroy code you can add:

  1. forobjectlayerunder(c)
  2. nodefunction(OnDestroy(a));

I'm curious why you need this though - group lists should automatically get updated when destroying objects which may provide some features you're looking for.

You can also create couplings to the objects under a container/folder node such that it effectively contains a list of object pointers - these are removed when the other end of the coupling is destroyed - keeping your list correct. This is how connections are maintained in the base objects and is a technique employed in numerous areas (e.g. process flow membership)

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