List Of Uv - Wrong Numbering

i've noticed that this is a common question but i can't find an answer...
i need to create an array ov uvs from selecion... i'm using the command

ls -sl -fl

the problem is that the numeration is wrong...
ex:

select -r pCylinder1.map[33] ;
select -tgl pCylinder1.map[32] ;
select -tgl pCylinder1.map[31] ;
select -tgl pCylinder1.map[30] ;
select -tgl pCylinder1.map[29] ;

but when i execute the command the result is
pCylinder1.map[29] pCylinder1.map[30] pCylinder1.map[31] pCylinder1.map[32] pCylinder1.map[33]

what can i do to get the right result?

sort :]

the problem is that they should NOT to be sorted...
if i select vertex 5 - 24 - 32 - 1 - 43 i want to be able to store them in this order...

QUOTE(ewerybody @ 06/26/06, 04:43 PM) [snapback]240837[/snapback]
[url=http://localhost:4449/Maya7.0/en_US/Commands/sort.html]sort[/url] :]

Ah I see! Sorry, wasn't clear to me.

component-ls always returns sorted component-numbers.

Maybe you have to setup a scriptJob, that collects freshly selected UVs (in a storage of your desire: attribute at your object or global string[]) at selection.

But that whould mean, that you'd have to explicit start collecting..

can u send me a link to something that can explain how to set a scriptJob? i've never heard about them...
anyway thank u for your help!

Well a scripjob will do it but thats double bokkeeping, but read this.

http://www.highend3d.com/boards/index.php?showtopic=224031

ok I did something similar in my moveScaleSew . (Its a small tool to use the standard Move And Sew feature from Maya without the distortion that occurs if the sewed edges are too different... but it works only with one edge and has no idea of what shell moveAndSew will move...)

For the automatic mode in moveScaleSew there is a scriptJob that executes a command in a variable at every selection change:

CODE
    scriptJob -parent moveScaleSewUVwin
        -event "SelectionChanged" "eval $moveScaleSewCommand";

So I can modify the command as I wish depending on where the user is in the workflow.. But of course you can put any command in there.
The -parent flag is used to attach the scriptJob onto a specified UI. This way its automatically deleted if you kill the UI. Otherwise you have to remember the ScriptJob ID and kill the ScriptJob later...

Now the -event flag is impotant for you: The string written thereafter describes what executes the second string. There are dozens of events. "SelectionChanged" is a very common for scriptJobs.

hope that helps .]