0

在 ArcMap 中,任何图层都只能通过Right Click->Selection->Make This the Only Selectable Layer 进行选择。我想通过 ArcMap API 以编程方式进行。我是arcgis的新手。

4

1 回答 1

1

我以这种方式解决了这个问题:非常简单的解决方案,我是arcgis的新手

private void MakeOnlySelectableLayer(IFeatureLayer stationFeatureLayer)
{
    var Focusmap = ArcMap.Document.FocusMap;

    for (int i = 0; i < Focusmap.LayerCount; i++)
    {
        if (Focusmap.get_Layer(i) is IFeatureLayer)
        {
            IFeatureLayer layer = (IFeatureLayer)Focusmap.get_Layer(i);
            if (stationFeatureLayer != null && !stationFeatureLayer.Equals(layer))
            {
              layer.Selectable = false;
            }


        }
     }
 }
于 2014-01-23T03:57:31.393 回答