C# component filtering point by condition


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:

zeroZ.gh (10.2 KB)

hope that helps


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();