Diferentiating between just one object selected or several
Hi,
Is there a way to test for number of objects selected?
$.count works only if there are more than one, $ as array as well.
I tried append myArray $ as well, but in case of several objects it will add only "$selection" as a value.
I'm at a loss here, any ideas?
Thanks!

Comments
Thanks a lot for the answers.
Thanks a lot for the answers. It really helped me today as I have been searching for help for quite a considerable time.
mov player download
Why you need to use finction
Why you need to use finction to get the count of the selected objects?
Just use
selection.countTry this:
1- create some objects in the scene
2- select some of them
3- in the listener type
selection.countand max will print the count of the selected objects. You can select multiple objects or single object.
So in the script you can use
If you want to select only one object from the selection just use
selObj = selection[1]Tools and Scripts for Autodesk 3dsMax
Thanks, it's what MKlejnowski
Thanks, it's what MKlejnowski suggested as well. I don't believe I haven't tried that myself!! :p
instead of $.count use
instead of
$.countuseselection.count. It can be used even when no objects are selectedemail: [email protected]
Huh.. Many thanks! Why didn't
Huh.. Many thanks! Why didn't I think of this?!?
Just for a curiosity value, here's my solution:
At least I learned how to use try/catch... lol