question

Sandy Huang avatar image
0 Likes"
Sandy Huang asked Sam Stubbs answered

How to use script to destroy all or certain number of items in a queue?

FlexSim 18.0.2
scriptdestroy object
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

Sam Stubbs avatar image
0 Likes"
Sam Stubbs answered

If you want to do this with a script, I would write a "while" loop.

  1. Object Queue = so().as(Object); // get a reference to your Queue.
  2.  
  3. while (Queue.subnodes.length > 0) // you can changes this to be whatever value you want.
  4. {
  5. Object item = Queue.first;
  6. item.destroy();
  7. }
  8.  
5 |100000

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