How to check layer name in VB.Net or C#

2438
1
10-29-2014 09:58 AM
JoseSanchez
Occasional Contributor III

Hi all

I am writing a toolbox for ArcMap and I would like to find a way to search for a layer even if the user changes its name in the table of contents.

r Instead of checking the layer name using layer.Name = "Parcels"  I would like to check the feature class name in Vb.net or C#.

How can I do that?

Thanks

0 Kudos
1 Reply
nicogis
MVP Frequent Contributor

you can use similar code:

  ESRI.ArcGIS.Carto.IFeatureLayer featureLayer = (ESRI.ArcGIS.Carto.IFeatureLayer) yourlayer

    ESRI.ArcGIS.Geodatabase.IFeatureClass featureClass = featureLayer.FeatureClass;

    and then cast IDataset and get your info ArcObjects 10 .NET SDK Help

0 Kudos