Help with list levels

I am very green with using Dynamo and am having some difficulty managing my lists with levels/lacing.

I am trying to replace all -1 values in my list. Fist, I grabbed the indices of the -1 values and am trying to replace values at those indices with new values. I cant seem to get the levels/lacing right on my last node. There should only be 13 values returned.

@phillip.austin

just use codeblock

f.e.

x == -1 ?  0 : x # 🏒 replace by anything

The issue here isn’t actually list levels, it’s the node itself. The out of the box ReplaceItemAtIndex node is specifically for a single list with a single item being replaced. It will not work for multiple items. You might be able to use a conditional statement instead or you can use one of the custom nodes for replacing multiple items in a list. There are a couple of options from some of the more common packages out there.

2 Likes

Draxl, can you be a little more descriptive on how to achieve this with a codeblock?

1 Like

That makes a lot of sense. I found one in another package that worked beautifully without having to do anything with the levels. Thank you!

@phillip.austin ,

thats a way very fast forward of filtering out elements