Hi Jake,
Thank you very much with your help.
I have modified the script but return error.
What is wrong with this script?
FYI, all the feature class locate under one dataset call Topo and also under version, is that the problem?
import arcpy
from arcpy import env
env.overwriteOutput = True
# Make a layer from the feature class
indexLyr = r"Database Connections\Connection to Metadata5K.sde\MY711T_5K"
indexLyrSelect = "MY711T5 Selection"
kode = arcpy.GetParameterAsText(0)
arcpy.MakeFeatureLayer_management(indexLyr, indexLyrSelect, '"SHEET_NO" = \'' + kode +'\'')
# Select all feature class that overlap aoi
env.workspace = r"Database Connections\Topo.sde"
for fc in arcpy.ListFeatureClasses():
arcpy.MakeFeatureLayer_management(fc, "fcLyr")
arcpy.SelectLayerByLocation_management(fcLyr, "INTERSECT", indexLyrSelect)
arcpy.GetCount_management("fcLyr")
result = int(arcpy.GetCount_management(fcLyr).getOutput(0))
print result