Help with developing a script

Hi. I’m following this YouTube tutorial (https://www.youtube.com/watch?v=s7tBe6DPZ3U) to recreate a Grasshopper script that generates walls (with inner plaster, brick layer, and outer plaster) from curves drawn in Rhino.

In the video, the author uses a Curve parameter to reference the curves, but in my setup I’ve replaced this with a Geometry Pipeline component.

The extrusion of the wall and custom preview work correctly for the first set of curves, but when I draw an additional wall, the custom preview no longer shows the new output.

First set of curves (a rectangle) on the left. Additional curve on the right.

The issue seems to be related to the List Item component that distributes the different wall layers (inner plaster, brick, outer plaster) to their respective Custom Preview components, because each new curve appears to add another item to the list and breaks the expected indexing.

Walls.gh (12.5 KB)

Absolute beginner, any help is appreciated.

If you don’t internalize the geometry, you won’t be able to see it.

Anyway, it seems that the problem arises from this Flatten:

I recommend organizing your walls with Data Trees. Then, you can access them using Tree Branch

Question, why (and which component) internalize geometry? Since I am using Geometry Pipeline Component, shouldn’t this be turned off to take live input from Rhino? Or do I draw all the walls first and THEN reference the curves?

Also, disabling flatten now outputs ALL results to achieve a single custom preview no matter how i route it.