ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MappingExtensions Class / SetActiveTopologyAsync Method / SetActiveTopologyAsync(Map,String) Method
The map to set the topology.
the geodatabase topology name or "Map" if map topology properties is required.
Example

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

    Parameters

    map
    The map to set the topology.
    topologyName
    the geodatabase topology name or "Map" if map topology properties is required.
    Exceptions
    ExceptionDescription
    Active topology cannot be set with the specified topology properties.
    Remarks
    Use "Map" to set the ArcGIS.Desktop.Editing.MapTopologyProperties for the map. Use the geoddatabase topology name to set the ArcGIS.Desktop.Editing.GeodatabaseTopologyProperties for the map.
    Example
    Set the current topology by name
    if (map.CanSetActiveTopology("TopologyName"))
    {
      await map.SetActiveTopologyAsync("TopologyName");
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.1 or higher.
    See Also