View Full Version : How can I Get Selected Object name ?

11 November 2003, 02:26 PM
How can I Get Selected Object name ? I cant found something about it in mel's help.
I think, this code like this or something like that.

string $sp[] = `getSelectedObjectName`;

Do you know ?

11 November 2003, 02:34 PM

string Sp[] = `ls -sl`;

This returns the names of any selected object into the array.

11 November 2003, 04:14 PM
I would add that I almost always use the -flatten flag as well. I do this because I am always looping over the selection array to do things to all members, and the -fl flag ensures that each member of the array is independant of all others.

i.e. if you select multiple vertices you want the info in the form

foo.vtx[0], foo.vtx[1], foo.vtx[2]

and not


string $sp[] = `ls -sl -fl`;

11 November 2003, 09:50 PM

that easy :bounce:

CGTalk Moderation
01 January 2006, 06:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.