Find common curves for two list of curves with different indexes

Hi everyone
Today I have such a problem / challenge.
(I’m just learning grasshopper)

I thought that I make a hole in this brep: /.

This edge (light green) is the common curve for red and green curves.
I wanted to find index of these selected curves (green curves) (using “item index”), but I couldn’t (item index returned -1).
And I thought that, later I would use, for example: set difference, set union, equality …), but I couldn’t find the indexes for these curves.

Maybe someone smarter have some idea?
Is it even possible to find these edges?

(sorry for my English)

ps. Maybe the way I selected surfaces is not very good, maybe you know better? (96.5 KB)

You are searching a list (from cull index) for curves (from list item) that don’t exist in the list you are searching (if you search a culled list for items you have culled, you will find nothing). -1 means no index, or the curves do not exist in that exact referenced list since you’ve culled them. You will need to search the entire edge list.

That being said, item index works with how your items are stored in memory (a bit of an advanced concept) and the way you first cull / list item the surfaces then deconstruct to get the edges, means that those edge instances exist in different parts of memory because it is a new list of the edges, not a referenced set, so this concept doesn’t work here unless you first get the edges, list item the branches you want, and search for them in the original edge list. (95.2 KB)

The Item index component can be a tricky concept to understand if you are not familiar about how data is stored in memory.

1 Like

" items are stored in memory"
No I am not familiar with this, (yet :grinning:)

Thanks for such an exact explanation.