The Index property is a number attributed automatically to all Objects when they are created. Its value for each Object corresponds to the order of its creation, e.g. the first Object created gets an Index of 1, the second of 2, and so on.

You can also get and edit an Object's Index through Visual Logic which is useful if you want to change multiple Objects' Index simultaneously. For example, the following piece of code loops through all Queues and if they have an Index value "1", it sets the Shelf Life of all the Queues to 20 (minutes or any other time unit you have selected in your simulation).
In this example, the Loop Object command is used for looping through the Queues, and obj_Queue is the object used as the Object parameter.
Use an index to make this process faster and less error-prone. First, consider how you might solve the problem without using the Index property.
First, create a spreadsheet called ss_Results, and type in the names of our Activities. On each line, you want to get the number of items exiting each Activity
To do this, you could create a Visual Logic section that named "Proc_Count Items". This section gets the Activity from which a Work item exited each time with the help of the Get Current Object command. Then, this section loops through the spreadsheet using a While loop until a cell in the first column matches our Activity's name. When this happens, add 1 to the cells on the second column, every time a Work Item exits the Activity that called the command (i.e the cell corresponding to each Activity gets incremented).
the Proc_Count Items Visual Logic section On Exit logic of each of our 6 Activities, so Get Current Object obtains the respective Activity.
While this approach helps us get the results we need, it's not versatile because you could make a spelling mistake when typing in the names of your Activities. Also, you would need to type in more names if you add more Activities to your model at a later time. Moreover, this requires looping, and this could slow down your simulation if you have many Objects to loop through.
This is where Index becomes useful.
Firstly, make sure to give your 6 Activities, an Index from 1 to 6. You can edit this directly via the Quick view window. This is to make sure Index can be used for cell referencing, in a way that matches your spreadsheet, i.e. where you want results to be placed.
Then, instead of looping, use Index to point Simul8 to the cell it should increment.
Changing the Index of each Activity manually can be lengthy in models with many Activities. You can assign the Index automatically by creating a Visual Logic section which executes the following:


That way, you set the right Index value to the right Object way more quickly.