ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MappingExtensions Class / SetActiveTopologyAsync Method / SetActiveTopologyAsync(Map,TopologyProperties) Method
The map to set the topology.
A ArcGIS.Desktop.Editing.TopologyProperties
Example

In This Topic
    SetActiveTopologyAsync(Map,TopologyProperties) Method
    In This Topic
    Sets the active topology for the map to the set of specified topology properties.
    Syntax
    Public Overloads Shared Function SetActiveTopologyAsync( _
       ByVal map As Map, _
       ByVal topologyProperties As TopologyProperties _
    ) As Task(Of TopologyProperties)
    public static Task<TopologyProperties> SetActiveTopologyAsync( 
       Map map,
       TopologyProperties topologyProperties
    )

    Parameters

    map
    The map to set the topology.
    topologyProperties
    A ArcGIS.Desktop.Editing.TopologyProperties
    Exceptions
    ExceptionDescription
    Active topology cannot be set with the specified topology properties.
    Example
    Set the current topology by topologyProperties
    // Sets the active topology for the specified map using the provided geodatabase topology properties.
    var gdbTopoProperties = await activeMap.GetTopologyAsync("TopologyName") as GeodatabaseTopologyProperties;
    if (activeMap.CanSetActiveTopology(gdbTopoProperties))
    {
      await activeMap.SetActiveTopologyAsync(gdbTopoProperties);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.1 or higher.
    See Also