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


ITopologyGraph4.BuildFromPolygon Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (GeoDatabase)  

ITopologyGraph4.BuildFromPolygon Method

Creates topo elements from all topology feature classes intersecting the specified polygon. The topology graph takes ownership of the input polygon.

[Visual Basic .NET]
Public Sub BuildFromPolygon ( _
    ByVal Extent As IPolygon, _
    ByVal preserveSelection As Boolean _
)
[C#]
public void BuildFromPolygon (
    IPolygon Extent,
    bool preserveSelection
);
[C++]
HRESULT BuildFromPolygon(
  IPolygon* Extent,
  VARIANT_BOOL preserveSelection
);
[C++]

Parameters Extent
Extent is a parameter of type IPolygon preserveSelection preserveSelection is a parameter of type VARIANT_BOOL

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

This method is very similar to Build, except the extent of the build isn't restricted to a rectangular envelope; any polygon can be used to define the build area.

[C#]
bool BuildTopoGraph(IGeometry buildGeom, ITopologyGraph topoGraph, bool
  keepSelection)
{
  if (buildGeom == null || topoGraph == null)
    return false;
  switch (buildGeom.GeometryType)
  {
    case esriGeometryType.esriGeometryPolygon:
      {
        ITopologyGraph4 topoGraph4=topoGraph as ITopologyGraph4;
        topoGraph4.BuildFromPolygon((IPolygon)buildGeom, keepSelection);
        return true;
      }
    case esriGeometryType.esriGeometryEnvelope:
      {
        topoGraph.Build((IEnvelope)buildGeom, keepSelection);
        return true;
      }
    default:
      return false;
  }
}
[Visual Basic .NET]
Private Function BuildTopoGraph(ByVal buildGeom As IGeometry, ByVal topoGraph As ITopologyGraph, ByVal keepSelection As Boolean) As Boolean
    If buildGeom Is Nothing OrElse topoGraph Is Nothing Then
        Return False
    End If
    Select Case buildGeom.GeometryType
        Case esriGeometryType.esriGeometryPolygon
            Dim topoGraph4 As ITopologyGraph4=TryCast(topoGraph, ITopologyGraph4)
            topoGraph4.BuildFromPolygon(CType(buildGeom, IPolygon), keepSelection)
            Return True
        Case esriGeometryType.esriGeometryEnvelope
            topoGraph.Build(CType(buildGeom, IEnvelope), keepSelection)
            Return True
        Case Else
            Return False
    End Select
End Function

See Also

ITopologyGraph4 Interface