List.UniqueItems Result

To me list.uniqueitems doesn’t give the result I would expect, not sure what others views on this are. If you have a given list of repeated values I would expect unique items to list only those that show up once in the list (are unique). See example below. I would expect the result to be just b. Interested to hear others opinions on this.

Unique ItemsWould help if I uploaded the image :slight_smile:

Hi Mark,

Actually I am very happy with the way List.UniqueItems works (in 0.6.3 there was no built-in node for this at all). Also, I think the term “unique list” in coding usually refers to this kind of command. I guess what you’d like is a node that counts (and maybe even filters by) the number of occurences of the members of a list. Maybe there’s an easier way to do this, but you could definitely do it this way:

FilterByOccurences

Hi Andreas,

Yes I had a similar work around, maybe I’ll wrap it up in a custom node. Personally I think it seems strange not to have a node that does that in the built in library, one for your clockwork package :wink:

I agree with Andreas. The name might be a little misleading. Maybe it might be worth changing it to List.ObjectTypes or something along the lines. What it does though, makes perfect sense and in my experience the operation that you are performing is actually far less common than what the List.UniqueItems does. Just a thought.

Fair enough Konrad, its good to get your opinions. As part of a training session I did for people at work it seems there are multiple nodes related to lists that are repeated elsewhere. As an example List.Count does the same as Count, List.Join does the same as Concat. The latter of the two work with elements as well rather than just lists but it seems silly in these particular cases to have the List nodes, I can only think it helps in the search bar?

@ Mark - I have indeed added this to the next batch of nodes for Clockwork. Will upload a new package version later this week.

@ Konrad - Although I have gotten used to the name, I think something like List.RemoveDuplicates may be more useful for new users when searching the node library. Although, to be fair, List.UniqueItems already shows up as a result when you search for “duplicate”.

Hi Andreas

I think this solution can be useful for me. Could you please reload the image with larger resolution to explore it?
Thanks

@jpTrujilloLevy - This is a post from the old forum so there’s no way to retrieve the images in a higher resolution, but the node I added to Clockwork at the time was most likely List.CountOccurences which gives you a) a list of unique items in your input list and b) a count for each of those unique items.

Original article here:
http://dynamobim.org/forums/topic/list-uniqueitems-result/