List.Map old 1.3.3 vs new 2.0.1

we had a script working in older version of dynamo 1.3.3
we recently migrated and facing this problem

in new we got these -1 values…

we are looking to get the following results in List.Map

List
0. 0

  1. 1
  2. 1
  3. 1
  4. 1
  5. 1
  6. 1

basically we are trying to find which of the unique list 0 or 1 does each individual member of watch list match.

Can some one help me how to get the same list map as old one.
Any help is much appreciated!

Since I could not add image in previous question, I am attaching what we are expecting this to do.
OldExample2

Sorry if this has already been asked and resolved. I searched and did not find similar thread.

Looks like you should try and change the lacing on your “IndexOf” node, shortest should suffice.

It’s not very elegant, but here’s another option.

1 Like

@KPRFramer another inelegant solution

3 Likes

Thank you for the quick reply. Yes even I thought it could be something similar, we tried all different variations of lacing on index of and unique items. But that did not work.

Yes! We did not try the work around. Thank you.

Thank you @Vikram_Subbaiah . Your replies in many posts have helped us in many bottleneck scripts and as usual simple and workable solutions. Again we did not try work around but this does help. We will use this for now, but I am still wondering how can this be resolved by using lists.

1 Like

Notice that the element input of IndexOf in pre 2.0 versions of Dynamo is a variable rank object:

image

Where as the new version accepts only a singleton. This, just like the “Contains” node is another case where the replacement is inadequate… :sweat: The 2.0 implementation is now identical to the “List.FirstIndexOf” node and is completely pointless.

Another way to synchronously compare all items in two lists is with a bit of python:

7 Likes

Like this maybe
indexOf.dyn (8.7 KB)

1 Like