Lacing on replacing item on index


He was initially trying to add items at an index but that was after he had already removed the same indices. What he was really looking for was a replace at index but it wasn’t working.


Yes you’ll need to flatten your list of rectangles. The list structure doesn’t match that of the indices (one index per element).

1 Like



you are probably right, I read the “insert” node as a wish to insert and not replace… so my mistake :slight_smile:
I can see now that it was replace that was the goal… but now there is a code for padding if someone can use that :slight_smile:


It was a little confusing. I didn’t realize it until I looked at why his indices were out of range.


Is there any way to do this with a list of lists? I am having trouble doing this with X number conduit runs. Thanks!


You could modify the code to work with lists of lists or you could wrap it in a custom node and use lacing.


Im afraid I dont know how to do either one of those things. If I wanted to create a custom node and use lacing would I just drop that pytho script node into the custom node environment and then create the same inputs and outputs? Thanks


Yup. That’s all it is.


Like this?


Yup. Now you can use lacing or list levels with the appropriate list structure to run the node on multiple lists.

1 Like

Thanks @Nick_Boyts, this little bit of Python is exactly what I need! Ever more reason to get my head around writing them myself! Cheers.