Ask the Simul8 Community

Count specific label in Activities/Queues

Created at
in Community support

is there a way to count specific labels in Activities and Queues via Visual Logic?
I found the "Get label total in object" command, but it just returns how many main work items are in the object.

Example Model:

Start Point - Label Action:

Current content Queue:

I was thinking about using the routing out function and built a queue for each material number, but therefore my model would be to confusing regarding to many different material numbers.

Can anyone help me please?
Best regards,


  • Was this answer helpful?


    Hello! You can build some code on that. I have an example for a Queue. Open a new Visual logic section and write in the following:
    LOOP 1 >>> i >>> Queue for Activity 1.Count Contents
    Select Current Work Item Queue for Activity 1 , i
    IF lbl_type = 1
    SET gbl_Count_Type1 = gbl_Count_Type1+1

    This loops through the Objects of a Queue, selects an item (i is used as a variable for looping, but on the second command is used for defining the position of the selected item in the Queue), checks whether the type of the selected item, and uses a counter variable for summing up the items with a Label value of 1.

    Cheers :)

  • Was this answer helpful?


    Thanks for your help! :)

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Attach file
Attach image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file