counting objects in selection

I have super simple question to ask.
How to count objects in selection and use this number as variable outside the loop, in random place of my code (wherever I want)
for e.

for t=0 to ....
(
count my object
t= number of my object
)

....
...
..
here i want t

I will be thankful for help.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kredka's picture

simple and work:)

thx work well

miauu's picture

.

To get how many objects you have in selection simply use

objsCnt = selection.count

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.