ObjRef compare

Could someone please confirm that comparing two ObjRef works?

//I have two lists:
List<ObjRef> A = new List<ObjRef>();
List<ObjRef> B = new List<ObjRef>();

//Not important stuff like adding GetObject Options settings etc. then

foreach (ObjRef entry in ga.Objects()) {A.Add(entry); }

foreach (ObjRef entry in gb.Objects()) 
{if (B.Contains(entry)) { continue; }

In debug I can see that ObjectId is the same for entry and ObjRef in list A. But B.Contains(entry) is always false even though I choose the same polysurface in Rhino.

List A

  •   ObjectId	{7083dbd3-ace9-4e9a-b4c6-64896dbe2424}	System.Guid

List B

  •   ObjectId	{7083dbd3-ace9-4e9a-b4c6-64896dbe2424}	System.Guid

It will create new ObjRefs pointing to the same object. You should compare object IDs instead.

Ahhh yes of course. Thanks for ultrafast reply.