This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IR > IRelationResult Interface > IRelationResult.RelationElement Property (ArcObjects .NET 10.4 SDK) |
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,
long* left,
long* 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
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
}
}