Hello readers & contributors,
I'm a part time non-advanced Pro user and have a layer feature count function inquiry.
I would like be able to have the feature account of a layer visible in a different location than the attribute table
even if the layer is off.
From the blog as I understand it the feature count can be visible 4 ways-
as a legend label, as a dynamic text label, as arcpy.getcount command
and in the attribute table. (I'm trying to avoid having million count layers on or loading it's attribute table)
Can I embed the feature count into the layer name alias?
Can I append the dynamic label code* or Legend label so it shows the feature count even when the layer is off?
Is there another way to see the layer count (such as in the layer properties).
I appreciate any advice but *I would need guidance with all code suggestions.
Thanks for reading,
Derek L.
Two quick way to get a feature count outside of the methods you described already:
Run the Get Count (Data Management)—ArcGIS Pro | Documentation geoprocessing tool in batch mode
Or open the Python window on the Analysis tab and in the Geoprocessing group, click the dropdown for Python and choose Python Window. In the Python window, copy/paste the following code into the bottom row of the Python window and hit enter to run:
db = r'<your path to the file geodatabase'
arcpy.env.workspace = db
for ds in arcpy.ListDatasets():
for fc in arcpy.ListFeatureClasses('','',ds):
fc_path = os.path.join(db, fc)
fc_count = arcpy.GetCount_management(fc_path)
print("{0} : {1} rows".format(fc, fc_count))