This document is archived and information here might be outdated.  Recommended version.


IRelationResult.RelationElement Property (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IR > IRelationResult Interface > IRelationResult.RelationElement Property
ArcGIS Developer Help

IRelationResult.RelationElement Property

The ith element of the relation. The indexes refer to elements of the left and right operand geometry bags.

[Visual Basic .NET]
Public Sub RelationElement ( _
    ByVal i As Integer, _
    ByRef left As Integer, _
    ByRef right As Integer _
)
[C#]
public void RelationElement (
    int i,
    ref int left,
    ref int right
);
[C++]
HRESULT get_RelationElement(
  long i,
  System.Int32* left,
  System.Int32* right
);
[C++]
Parameters
i 

i is a parameter of type long left [out]
left is a parameter of type long* right [out]
right is a parameter of type long*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.
[C#]

void DemoRelationElement(IGeomtryCollection geomColl1, IGeometryCollection geomColl2)

{

         IRelationalOperatorNxM relOpNxM = geomColl1 as IRelationalOperatorNxM;
         IRelationResult relRes = relOpNxM.Within(geomColl2 as IGeometryBag);

         int count = relRes.RelationElementCount;
         int left, right;

         for (int i = 0; i < count; i++)
         {
                 relRes.RelationElement(i, out left, out right);
                 IGeometry geom1 = geomColl1.get_Geometry(left);
                 IGeometry geom2 = geomColl2.get_Geometry(right);
                 //geom1 of geomColl1 is Within geom2 of geomColl2

         }

}

See Also

IRelationResult Interface