0

I am newbie in ArcObjects. I am trying to fetch the featureclass name from layer properties under Data Source.

I am able to get the red-marked text via ILayer, IFeatureLayer, IFeatureClass. Is there any way to get the yellow-marked text, as it remained constant if I add same layer with different Definition Query?

enter image description here

1 Answer 1

1

Both IFeatureClass and IFeatureLayer are interfaces on the FeatureClass and FeatureLayer objects, respectively. These objects are very common to interacting with the features on the map and in the underlying data. I would suggest reviewing all the possible interfaces these objects implement here and here. This is the 10.3 documentation, but applies at least 99.5% to later versions, and the 10.3 site functions the best in my experience. Upon reviewing this you will see that you can get the name of the feature class like so:

IFeatureLayer layer;
(layer.FeatureClass as IDataset).Name;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.