I haven't read everything but:
you can sort an Array without a script:
macke a new string expression
Edit custom Model->delete all inputs->create a new float array input named "NumbersArray"->create a bool Input named "Reverse".
add the following text as expression (including the brackets)
Code: Select all
{
Array.Sort(NumbersArray);
if(Reverse)Array.Reverse(NumbersArray);
return String.Join("\r\n",NumbersArray);
}
create a string splitter node and connect it to the output of the string expression
connect you array (int or float) to the NumbersArray of the string expression
works as well for string arrays (just change the float array to string array)
done
you now have a sorted array and with the reverse bool you can set it from ascending to descending