1

I am using ArcMap add-in to perform a topology validation. I have defined a topology in the geodatabase and add it in ArcMap TOC. When I try to get the current topology using ArcObjects, I get this message : "current no topology available".

My code is shown below:

Public Sub ReturnCurrentTopologyType()
    Dim extUid As UID = New UIDClass()
    extUid.Value = "esriEditorExt.TopologyExtension"
    Dim topologyExt As ITopologyExtension = TryCast(My.ArcMap.Application.FindExtensionByCLSID(extUid), ITopologyExtension)
    If topologyExt.CurrentTopology Is Nothing Then
        MsgBox("Current no Topology available")
        Exit Sub
    End If
    If TypeOf topologyExt.CurrentTopology Is IMapTopology Then
        MsgBox("Current Topology is a map topology")
    Else
        MsgBox("Current Topology is a geodatabase topology")
    End If
End Sub

Now I am not sure what I miss for getting the current topology. I am using ArcObjects 10.2.1 and vb.net(vs 2012). Please advise me, thanks.

  • 1
    I think you need to be inside an edit session to be able to access topology. – Hornbydd Jul 31 '14 at 9:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.