How can I get the feature count of a layer?

631
1
Jump to solution
12-08-2017 12:32 AM
Highlighted
Occasional Contributor

I have to write an add-in for our technicians where in a dockpane I want to show the total amount of features in the layer. So far I only found how to get the count of selected features, but that doesn't help me, since I don't want to run a 'select all' every time there is something going on at the side of our technicians.

In Python there is a getCount method. Is this function available in C# as well.

Bests Thomas

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Regular Contributor

Hi Thomas,

FeatureClass has method GetCount().

                            FeatureClass pFeatClass = featLayer.GetFeatureClass();
                            int nCount = pFeatClass.GetCount();

View solution in original post

Reply
0 Kudos
1 Reply
Highlighted
Regular Contributor

Hi Thomas,

FeatureClass has method GetCount().

                            FeatureClass pFeatClass = featLayer.GetFeatureClass();
                            int nCount = pFeatClass.GetCount();

View solution in original post

Reply
0 Kudos