View Full Version : querying which compent type (e.g vertex) is selected

10 October 2005, 10:25 AM
Hi all,

Havent done much MEL before, and I have what should be a really simple question. I have a selection, and have stored it in an array. The selection will either be of edges, verticies or faces. My code reacts differently depending on which component type is selected, but I cannot figure out how to test whether it is verticies, faces, or edges that are selected.

I have looked for flags in the "ls", "selectType" etc commands, but not finding anything. I just need any sort of test to tell me whether it is verticies, edges, or faces, in my selection list.

Any help will be greatly appreciated, since this is the missing link to a little modelling tool.

Thanks everyone,


10 October 2005, 03:20 PM
string $vertAry[] = `filterExpand -ex true -sm 31` ;
string $edgeAry[] = `filterExpand -ex true -sm 32` ;
string $faceAry[] = `filterExpand -ex true -sm 34` ;

//make a function to determine which array has data
//this way we can add as many arrays as we'd like
int $numArys = 3;
int $i,$j;
for ($i = 0; $i < $numArys; $i++)
if ($i == "")
$j = 1;
return $j;

10 October 2005, 04:06 PM
Works a treat! That "filterExpand" is very useful, just opened up a whole bunch of options I never knew about! Thanks for taking the time to write that out as well. It is just what I am looking for!

Thanks and take care,


CGTalk Moderation
10 October 2005, 04:06 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.