question

Tyler Morrison avatar image
0 Likes"
Tyler Morrison asked Matthew Gillespie answered

How to delete all objects that are pulled from a list

custom-combiner-using-triggers.fsmI have a model where one item enters a processor, processes the item, pulls 3 more items of the same type from a list, and then outputs the first item onto a conveyor. I'd like to have the 3 additional items that are pulled from the list using the processor on entry trigger destroyed once they are pulled. When I use the destroyobject command once the items are pulled, it only deletes the first item pulled, not all 3 items. How would I make all 3 items get deleted. My model is attached.

FlexSim 19.0.3
processorlistpull from listtriggersdestroyobject
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

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered

In the Pull from List popup the variable pulled is an Array of all the pulled items. However, the destroyobject() command only takes a single treenode. You need to loop over all the contents of the pulled array and call destroyobject on each array element. See the attached model.

arrayloop.fsm

Note in this model I'm using the moveobject() command to move the items into a sink where they're destroyed because that feels safer to me.


arrayloop.fsm (32.6 KiB)
5 |100000

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