# Remove Z values of Coordinate List based on Another Coordinate List

So I have spinning my wheels on this one for a couple days now:

## List A

Basically I have a list of coordinates, organized into a sublist based on their X and another sublist based on their Y value, leaving me with in essence a stack of points, with a variable Z position. These stacks are arrayed out across a large area both in the X and Y direction

## List B

I have another List of coordinates that I have manged to organize the same way as List A; only this list contains only one point. Note that the X and Y of each point corresponds to one ‘Stack’ or sublist found in List A.

What i’m trying to do is remove the entries of List A that have a Z value below the corresponding entry of List B. (By corresponding I mean the List B entry that matches the X and Y entries that defines the sublist ‘Stack’ of List A). Note that not every List A sublist ‘Stack’ contains 5 entries, and not all results would have only one value removed (it could be 0 it could be 5).

I apologize for not showing what I have tried; but thus far I haven’t even been able to get close. Typically I would write a series of 3 nested ‘For’ statements applied to List A. The first to find a matching X coordinate of the current Z Check Value. the second to find a matching Y. The last to process the Z Coordinates. Unfortunately I’m having a hard time making all the needed references to do this in python and pass the results back to Dynamo.

Is this what you’re looking for? Play around with the levels on the ‘>’ operator node to get the desired outcome.

T_Power, First thanks for the quick reply. I didn’t even realize the that’s what the levels filter did, and based on my understanding I’m not sure how this works.

However it looks like there is something wrong with the results. Why would the top point, circled in red appear as if it was in sublist 10, highlighted, while bieng labeled as a duplicate label of the lowest entity. Clearly a point with those coordinates clearly does not appear in the results list??

(sorry orientation of List A and List B got fliped)

It’s hard to tell if that’s the point that corresponds to the point in the results you’re looking for. Dynamo shows you every point that is created. To be sure you could disable the preview of every node by right clicking and deselecting preview.
If the point still shows up then I would need to take a closer look at your script.

Thanks T_power, I did turn off all preview but the current one and was still getting incorrect data sets. Each point of my data set was a centroid of a model element. I wanted to pass a variable through to each specific model element which didnt work due to restructuring/rounding the data set at some point in the workflow.

Is there a way to pass a variable to every piece of geometry that contains a point from a list? Everything I found so far was checking if the point was inside the bounding box, not the bounding box contain a point. I apologize for the change in workflow.