IMapTopology.AddClass: NotImplementedException

529
2
02-07-2013 11:16 AM
Marc-OlivierEthier
New Contributor II
Hi,

Is it normal that in ArcGIS for Desktop 10.1

_topologyExt.MapTopology.AddClass(_featClass)


throw Exception: NotImplementedException occured: {"The method or operation is not implemented."} ?

And

TypeOf _featClass Is ITopologyClass

return False ?
Is there a way to obtain a IMapTopology2 from ITopologyExtension ?
0 Kudos
2 Replies
by Anonymous User
Not applicable
The exception is expected. Map topologies are layer based in 10.1 rather than feature class based. You can use the IMapTopology2.AddLayer method to add feature layers to the map topology. Also take a look at the Working with topologically related features help topic for examples on casting the topology extension.
0 Kudos
by Anonymous User
Not applicable
The following works for me.

      UID extUid = new UIDClass();
      extUid.Value = "esriEditorExt.TopologyExtension";
      ITopologyExtension topologyExt = ArcMap.Application.FindExtensionByCLSID(extUid) as ITopologyExtension;
      IMapTopology2 mt2 = topologyExt.MapTopology as IMapTopology2;
      ArcMap.Application.StatusBar.set_Message(0, mt2.LayerCount.ToString());
0 Kudos