C# component filtering point by condition

Hello.

I am trying to make a C# component that filters a list of points. The idea is to filter the points so that only points with the z-coordinate of zero gets on the new list. Can somebody help with this? I am very new to C#.

Hey user

depending on what structure you need to go forward, you have two options:

file:
zeroZ.gh (10.2 KB)

hope that helps

Ben

The classic way is a simple LINQ query (declare tol as static double: document tolerance, pList your valid List of points (not Point3d.Unset)):

var query = pList.Where(x=> Math.Abs(x.Z)<tol).ToList();