Find index and use it to set parameter

Hi there,

I would like to retrieve all indexes of the “true” or “0” values as seen in the picture. When I retrieved those indexes I would like to use the indexes to set the parameters of the walls to a new parameter.

Anyone got any ideas?

Welcome - I typically use Clockwork’s List.ReplaceItemAtIndex+ (the plus version allows multiple)

I also use List.AllIndiciesOf when looking for trues

I think you dont need to retrieve those indices, try this:

[2019-11-26] Dynamo Forum Post dylanUZJPA.dyn (18.8 KB)

PS: You can use the node “AllIindicesof” with a boolmask as second input to get all the indices of the true values.

3 Likes

Thank you for your reply, actually I need the indexes of the true’s so I can use them to then set the corresponding wall type parameter to a new wall type

Hi Adam, I thought about using that as well except if I try it it either returns Empy List or -1. Do you know why?

You need to use list levels. IndexOf is looking at each item within your supplied list - which are sublists. It’s telling you that none of the sublists are equal to true.

2 Likes

Yeah just like Nick said, use lists levels, your node is now looking at the wrong list level.
You can change list levels with the small “>” on every node.

image

in a piece of data there are levels, for each sublist there creates another level. you want to run the node on a specific level while retaining the structure of the list.

https://dynamobim.org/introducing-listlevel-working-with-lists-made-easier/

2 Likes