import arcpy inputFC = arcpy.GetParameterAsText(0) #Input for the script tool #Evaluate if input has greater than 0 features if (arcpy.GetCount_management(inputFC) > 0): arcpy.SetParameterAsText(1, "true") #Output Boolean parameter for feature count greater than 0, set to true arcpy.SetParameterAsText(2, "false")#Output Boolean parameter for feature count equal to 0, set to false arcpy.AddMessage("Feature count greater than 0") #If it does not have greater than 0 features it will have 0 else: arcpy.SetParameterAsText(1, "false")#Output Boolean parameter for feature count greater than 0, set to false arcpy.SetParameterAsText(2, "true")#Output Boolean parameter for feature count equal to 0, set to true arcpy.AddMessage("Feature count equal to 0")
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.