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

 

posted @ 2022-01-18 14:40  yzhyingcool  阅读(370)  评论(0编辑  收藏  举报