C#代码段
IMxDocument mxDocument = m_application.Document as IMxDocument; IContentsView contentsView = mxDocument.CurrentContentsView; object selectedItem = contentsView.SelectedItem; if (selectedItem is IFeatureLayer) topology.InFeatureLayer = selectedItem as IFeatureLayer; else { new AlertWindow("未选择待检查图层或者选择了多个图层!", false).Show(); return; }