ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / TopologyLayer Class / GetTopology Method
Example

In This Topic
    GetTopology Method
    In This Topic
    Gets the topology dataset associated with the layer. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetTopology() As Topology
    public Topology GetTopology()

    Return Value

    The topology dataset associated with the layer.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Create Topology Layer using Topology dataset
    {
        //Get the Topology of another Topology layer
        var existingTopology = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TopologyLayer>().FirstOrDefault();
        if (existingTopology != null)
        {
            var topology = existingTopology.GetTopology();
            //Configure the settings for a new Catalog layer using the CatalogDataset of an existing layer
            var topologyLyrParams = new TopologyLayerCreationParams(topology);
            topologyLyrParams.Name = "NewTopologyLayerFromAnotherTopologyLayer";
            topologyLyrParams.AddAssociatedLayers = true;
            //Note: Needs QueuedTask to run
            LayerFactory.Instance.CreateLayer<TopologyLayer>(topologyLyrParams, MapView.Active.Map);
        }
    }
    Requirements

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

    ArcGIS Pro version: 3.1 or higher.
    See Also