Assuming the layers are all in the current MXD, you could try something like this using Python and arcpy:
extentOfInterest = arcpy.Extent(xmin, ymin, xmax, ymax)
mxd = arcpy.mapping.MapDocument("CURRENT")
for layer in arcpy.mapping.ListLayers(mxd):
if extentOfInterest.overlaps(layer.getExtent()):
print "Layer overlaps and will be processed: " + layer.longName
# Clip, etc here
Replacing xmin
, ymin
, xmax
and ymax
with the minimum and maximum values for your extent of interest. You could even turn it into a script tool, and pass these values in as parameters.
Alternatively, you could create the extentOfInterest as the envelope of a polygon feature.
Optionally, you can filter the layers by the layers' names (as a wildcard string in the ListLayers()
), or by which group they are in (using the layer.longName
, which includes group hierarchy), to process only the layers that you're interested in.
UPDATE: As suggested in comments below, you may also want to filter the layers based on layer.isFeatureLayer
and/or layer.isGroupLayer
. It depends on what your needs actually are.
{}
button that enables you to format any highlighted code nicely.