def execute(self, parameters, messages): """The source code of the tool.""" import sys sys.path.append(CUSTOM_PATH) import pEnki.ENKI_prepinput as ep ep.prep_input(parameters)
# # Process: Polygon to Raster for shp, field in selects: arcpy.AddMessage("trying to create {0} raster".format(field)) try: res = arcpy.PolygonToRaster_conversion(shp, "FID", "{0}_{1}.tif".format(RegionName, field), "CELL_CENTER", "NONE", "1000") arcpy.AddMessage('Created: {0} raster'.format(field) ) except: arcpy.AddWarning( arcpy.GetMessages(2) )
Solved! Go to Solution.
res = arcpy.GetMessage(2) arcpy.AddWarning( res )
res = arcpy.GetMessage(2) arcpy.AddWarning( res )