List.UniqueItems to Tag.ByElement

My List is a list of unique values. I just need one of the elements pertaining to one of the values. e.g. value 7 could have 10 different elements but I only need one of them to be tagged (doesn’t matter which).

How would I separate that so I can connect it to the Tag.ByElement?

You can use a List.IndexOf node (using the Unique list as the values to search for) and then use a List.GetItemAtIndex node to get the first corresponding element. For example, if you have a list of elements [A, B, C, D, E, F] and a list of parameter values of [1, 1, 2, 2, 1,1]. Your unique list would be [1, 2]. The first index of these numbers would be 0 and 2, respectively. Using these indexes, you can get elements A and C.

2 Likes

Hm. Having some trouble. Could you do a quick mock-up?

List.Uniqueitems goes to IndexOf[List] but I’m not sure what goes to IndexOf[element]

See below:

For some reason, My IndexOf doesn’t have List. in front of it like yours does. This is where my error says -1. Not sure why.

It is because of Lacing. You should have Lacing “Auto” but you use old version of Dynamo. I don’t know how the solution was…

Is this a matter of using a more recent version of Revit? I’m on 2018

Try to install Dynamo 2.0.3
https://dyn-builds-data.s3-us-west-2.amazonaws.com/DynamoInstall2.0.3.exe

1 Like

That fixed everything thanks!