Message 1 of 3
Return the number of selected objects

Not applicable
09-28-2012
08:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I trying to make a simple script to get the number of selected objects in the scene.
I have trying with that :
macroScript NbrObjectSelected category:"TestTools"
(
nbrObjects = selection.count
if (nbrObjects) == 0 then
messagebox "Please, select one or more object"
else
(
textNbObjects = nbrObjects as string
print "Objects selected = "+textNbObjects
)
)
It works not very good without the macroscript header : he print 1 "Object Selected =" (without the number
and another time with the number... strange.
And when I include the Macroscript header, it dosen't work, I have only "objects selected : "...
Anyone can help me ?
Regards.
I trying to make a simple script to get the number of selected objects in the scene.
I have trying with that :
macroScript NbrObjectSelected category:"TestTools"
(
nbrObjects = selection.count
if (nbrObjects) == 0 then
messagebox "Please, select one or more object"
else
(
textNbObjects = nbrObjects as string
print "Objects selected = "+textNbObjects
)
)
It works not very good without the macroscript header : he print 1 "Object Selected =" (without the number
and another time with the number... strange.
And when I include the Macroscript header, it dosen't work, I have only "objects selected : "...
Anyone can help me ?
Regards.