PDA

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


safakoner
11-20-2003, 01: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 ?

ajk48n
11-20-2003, 01:34 PM
Try:

string Sp[] = `ls -sl`;

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

mhovland
11-20-2003, 03: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

foo.vtx[0:2]

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

safakoner
11-23-2003, 08:50 PM
thanks

that easy :bounce:

CGTalk Moderation
01-16-2006, 05: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.