I am stuck with a code due to a RunTimeError: Object: Error in Executing tool and I really can't find the mistake. The code is
# Now, the script for "Adding Surface Info" to the network, using the raster with MAX MEAN defined just above
# Set the raster of input, on the basis of the MAX MEAN
inSurface = "C:/B3061239/!!! WORK !!!/RAS_for_maxmean/", NameRasList[MEANlist.index(max(MEANlist))]
# NOTE that NameRasList[MEANlist.index(max(MEANlist)) has been calculate before
method = "BILINEAR"
if inSurface:
print "Got inSurface"
# Create list of feature classes
fcList = arcpy.ListFeatureClasses()
print str(len(fcList))
# Process: Add Surface Information
if fcList:
print "Got featureclasses"
for fc in fcList:
desc = arcpy.Describe(fc)
print desc.name
# Determine if the feature is 2D
#if not desc.hasZ:
#if desc.shapeType == "Polygon":
# Desired properties separated by semi-colons
#Prop = "Z_MIN;Z_MAX"
#elif desc.shapeType == "Point":
#Prop = "Z"
#elif desc.shapeType == "Multipoint":
#Prop = "Z_MIN;Z_MAX;Z_MEAN"
#elif desc.shapeType == "Polyline":
#Prop = "LENGTH_3D"
# Execute AddSurfaceInformation
arcpy.ddd.AddSurfaceInformation(fc, inSurface, "Z_MAX", method, "", "1", "0", "NO_FILTER")
print "Completed adding surface information."