Can't compare 2 lists of points


Hi, I’m trying to compare 2 lists of points. I know for sure that at lease the first item is the same in both lists, and at least few of the other points aren’t the same. I made sure that the structure of the lists is the same.
List equals wont work.
Can anybody help?

Thanks!

Hello!

Compare X,Y,Z values you can call it with codeblock.

x.X;
y.Y;
z.Z;

KR

Andreas

1 Like

@amitQFEU3 try it by setting the Lacing to Longest

@tradelie tried, still not working.

@Draxl_Andreas
I’m not sure how to use it in code block, van you please demonstrate?

If your ultimate goal is to remove the duplicate points from the list, then Point.PruneDuplicates is a great option.

Hi there,

I tried your workflow and it works fine for me, however I am creating points and I believe you are extracting them from Revit (is that correct?). In that case, I’m guessing that dynamo doesn’t see the points as equal because of tolerance. You can try to round out the X, Y and Z values and compare those.
Example done with code blocks:

An alternate way of writing this is replacing “Point.X(pt)” by “pt.X” (Like Draxl mentioned)

Hope this works!

1 Like

Perhaps impler still:

pnts1 = PointListA;
pnts2 = PointListB;
str1 = “”+ pnts1.X+pnts1.Y+pnts1.Z;
str2 = “”+pnts2.X+pnts2.Y+pnts2.Z;
equalityCheck = str1==str2;

Or try Geometry.IsAlmostEqualTo.

1 Like

Hello, I strongly advise you to read this pdf document by Mr. Sol Amour link

It’s clean and precise, I’m making a lot of progress with this one.
Good reading and implementation.
I am a beginner.
Cordially
christian.stan