List.ContainsItem not working?

I’m trying to compare lists of points. For some reason, the points that are being generated from within Dynamo, don’t read as equal to points being pulled from families inside Revit, even though their coordinates are identical.

I’ve tried several other nodes as well, but always get the same result. What am I missing?

Hi, to compare lists of points, you will need to turn them into strings with a String from Object node. The initial list can then be filtered with a List.FilterByBoolMask node

Good idea, I’ll try that.

Any idea why it doesn’t work as is? If I compare points created within Dynamo to one another, it works just fine. It seems that it’s only when I’m pulling in points from Revit elements that it stops working.

Strange indeed, it works for me now with points when I simply use Flatten nodes after my lists of points. However, I can’t really tell if I missed something yesterday or not…

I believe that points from Revit can’t always be compared because of rounding issues. As a workaround you could check if the distance between two points is within a certain margin to check the points for equality.

I think that’s it. When I converted the points to strings, I was able to see this:

I think I can get around this with the Lunchbox Point.RoundToPrecision node.

1 Like