List.UniqueItems is letting me down

In the group of nodes marked with pink the ‘List.UniqueItems’ just returns its input list without performing any filtering. I’m wondering why, does anybody have an explanation?

In my understanding, sometimes UniqueItems treat some items as similar but not the same, depending on how they are obtained…
For your case, you could compare those objects as strings using a python script, so if they are equal, it considers them as the same item

this should work!

I typically use Clockwork’s List.CountOccurences as it outputs unique elements and the counts. I have had good functionality from this node and have noticed what you are seeing with the Unique Items from time to time.
CountOccurences

Thanks to both of you for your answers.

The ‘List.CountOccurences’ gives the same output as ‘List.UniqueItems’ in my case.
I’ve tried out the python script as well, but without any luck.

Hi @Daniel_Kolling_Ander

1 Like

You wrote it wrong! Remove one ident at lines 17 and 18. “if not added” should be outside the second “for”

This is a known issue that was fixed a while ago but somehow didn’t make it into the last official builds. See https://github.com/DynamoDS/DynamoRevit/issues/1680 for more info. I currently use @Kulkul 's approach as well.

1 Like

Oops, my bad! Fixed it and now it’s working

Thanks Kulkul, Andreas and Ricardo.

As I ultimately intended to manipulate the selected categories further by introducing a new parameter, I’ve gone for the python-workaround, as this solution doesn’t remap the categories into strings but preserves the category data class.

1 Like