ArcObject获取ArcMap内容列表选中的图层


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;
            }

相关