#START OF CODE # Import system modules import arcpy from arcpy import env # Set environment settings - make this where your output will be going env.workspace = "C:/data" # Set local variables - make these whatever you need them to be inFeatures = "ca_counties.shp" valField = "NAME" # This is the field that must change to represent each of your fields # so instead of using this we will use fieldList[count] so that were using EVERY field name in the table outRaster = "c:/output/ca_counties" assignmentType = "MAXIMUM_AREA" priorityField = "MALES" cellSize = 0.5 fieldList = arcpy.ListFields(filename) #creates a list that contains all of the field names from the attribute table of 'filename' #change filename to the file you're using count = 0 while count < len(fieldList): arcpy.PolygonToRaster_conversion(inFeatures, fieldList[count], outRaster, assignmentType, priorityField, cellSize) #perform the conversion using every field name contained in fieldList count += 1 #END OF CODE
Hi,
Did anyone ever come up with a solution to this problem using Model Builder? I have the exact same issue, but all the solutions proposed here involved ArcPy and I'm not familiar with that program. I've been trying to do it in Model Builder but have not been able to get it to work.
Thanks,
Josh