判断要素所在图层

Posted on 2015-05-13 17:37  云起  阅读(7)  评论(0)    收藏  举报  来源
IFeatureLayer pf = axMapControl1.get_Layer(3) as IFeatureLayer;
IFeature pff = pf.FeatureClass.GetFeature(2);
IObject ob = pff as IObject;
for (int i = 0; i < axMapControl1.LayerCount;i++ )
{
    if (ob.Table.Equals(((axMapControl1.get_Layer(i) as IFeatureLayer).FeatureClass)))
        MessageBox.Show(i.ToString());
}

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3