How to delete all objects that are pulled from a list

How to delete all objects that are pulled from a list

tyler_morrison5B36Q
Contributor Contributor
20 Views
1 Reply
Message 1 of 2

How to delete all objects that are pulled from a list

tyler_morrison5B36Q
Contributor
Contributor

[ FlexSim 19.0.3 ]

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.

0 Likes
Accepted solutions (1)
21 Views
1 Reply
Reply (1)
Message 2 of 2

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

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.



Matthew Gillespie
FlexSim Software Developer

0 Likes