Hi @guoyi ,
If you have a resource that points to a group of queues, you can acquire that resource onto your token (token.resource) to get an individual queue. Then FlexSim automatically takes the first object to Queue1, the second to Queue2, and so on. This is demonstrated here:


craneexample.fsm
You can also accomplish this by adding a variable which changes with each token. The first token will be 1 and send it to the first queue in the group. The second token will set the variable to 2 and go to the second queue. This gives you more control over what the code is doing to decide the destination.



UnloadTSinGroup.fsm
Note: this custom code changes between 3 queues (1 sets to 2, 2 sets to 3, and 3 sets back to 1). You will have to change it according to your model
Finally, if you are simply wanting to reference the objects within the queue and choose which queue to be your unloading object. Use this syntax:
Group("Queues")[1]
This selects the first member of the group titled "Queues"
Hopefully this helps!