Skip to content

How to get no. of currently selected element ? #25

Answered by Rebecca-Coding21
LakuszJ asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @LakuszJ,
you can use the function "get_all_selected_objects". The function returns an array of all selected objects. With help of a foreach-loop you can access each object in the array and get the no. of the objects:

object_location[] selected_objects = get_all_selected_objects();
List<int> object_numbers = new List<int>();

foreach (object_location object in selected_objects)
{
    object_numbers.Add(object.no);                      
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Rebecca-Coding21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants