Sorting list based on sorted point list - Error

Dear,

I’m trying to sort a list based on a list points. I’m using the “list.SortByKey” node, being the point list the keys, but it’s not working. Additionally, I can sort the list point with “List.Sort” node without any problem.

Find pics below to explain the issue.

How do you want to sort your points list? You could try the nodes list.indexof and list.getitematindex after your List.Sort node. (if the List.SortByKey node doesnt work with a list of points as keys) :slight_smile:

1 Like

I don’t really care the “How I want to sort”, I’m caring on why it’s working with “List.Sort” node and it’s not such as key on “List.SortByKey” node

points are not intrinsically comparable - List.Sort tries to sort the input list in a few different ways, likely it just settles on using the hashcode (see last line), which might kind of work, if the hashcode is based on the fields of the point, you might get exact duplicates near next to each other - but it’s not precise enough to be valuable unless you know all the details.

3 Likes