You'll probably want to start by following the examples for a SearchCursor, but instead of setting the path to the data, you're deriving it based on the layer and the layers dataSource property. Then, you can begin iterating over the values within the Search Cursor and either add it to a list if it doesn't exist already or use set() to get unique values.
>>> usingSet =  >>> usingUnique =  >>> mxd = arcpy.mapping.MapDocument("CURRENT") >>> df = arcpy.mapping.ListDataFrames(mxd) >>> for layer in arcpy.mapping.ListLayers(mxd): ... lyrPath = layer.dataSource ... with arcpy.da.SearchCursor(lyrPath, ['ID']) as cursor: ... for row in cursor: ... if not row in usingUnique: ... usingUnique.append(row) ... usingSet.append(row) ... print(usingSet) ... print(set(usingSet)) ... print(usingUnique) ... [1, 1, 2, 2, 3, 4] set([1, 2, 3, 4]) [1, 2, 3, 4]
If you're going to iterate over multiple layers, you'll need to look into looping through the fields using ListFields to create the fields list for the cursor.
>>> from collections import Counter >>> with arcpy.da.SearchCursor("locations","points") as cur: ... count = Counter(cur) ... >>>
Not only will you get the unique values, you will get their counts as well.