When running the following script, I get the error saying that I need a value for “origin_coord” and for “y_axis_coord”. So is it not enough to define a template dataset? But how can I fill the “origin_coord” and “y_axis_coord” parameters with Arcpy working with ArcMap 10.0? Because in the loop are a lot of shapefiles from different cities, so I need a loop.
import arcpy
import os
from arcpy import env
env.overwriteOutput = True
env.workspace = r"D:\Users\julia\out_09_09\urbanA"
env.qualifiedFieldNames = False
#make a list with input cities as shapefiles.
fcList = arcpy.ListFeatureClasses()
for shpFile in fcList:
shpFileName= os.path.splitext (shpFile) [0]
print shpFileName # works
# Process: Make Feature Layer
arcpy.MakeFeatureLayer_management(env.workspace + "\\" + shpFile, "shpFile_ly")
# join the city with the reclasstable
jointable = r"D:\Users\julia\out_09_09\reclass.dbf"
arcpy.AddJoin_management("shpFile_ly", "CODE", jointable, "joinCODE", "KEEP_ALL")
# Process: Copy Features
outFeatureClass = shpFileName + "_join.shp"
arcpy.CopyFeatures_management("shpFile_ly", outFeatureClass)
# Process: Polygon to Raster
outraster = shpFileName + "_join.img"
cellSize = 200
arcpy.PolygonToRaster_conversion(outFeatureClass, "CODE", outraster, "CELL_CENTER", "NONE", cellSize)
# Process: Make Raster Layer
arcpy.MakeRasterLayer_management(outraster, "outraster_ly")#works
# Process: Add Join
arcpy.AddJoin_management("outraster_ly", "Value", jointable, "code", "KEEP_ALL")
# Process: Copy Raster
outraster2 = shpFileName + "_join2.img"
arcpy.CopyRaster_management("outraster_ly",outraster2) #works
# Process: Raster to Polygon
outPolygons = shpFileName + "reclass.shp"
arcpy.RasterToPolygon_conversion(outraster2, outPolygons, "NO_SIMPLIFY", "Value")#works
# Process: Create Fishnet
cellSizeWidth = "200"
cellSizeHeight = "200"
outFishnet = shpFileName + "_net.shp"
arcpy.CreateFishnet_management(outFishnet, "", "", cellSizeWidth, cellSizeHeight, "0", "0", "", "NO_LABELS", outPolygons, "POLYGON")

Is there someone who can help me? I’m trying it without the Iteration but it is not working even if I add a layer before? Why?
import arcpy
from arcpy import env
env.overwriteOutput = True
env.workspace = r"D:\Users\julia\erste_aufg"
# Process: Make Feature Layer
#arcpy.MakeFeatureLayer_management(r"D:\Users\julia\erste_aufg\de013l_hannover \de013l_hannover\de013l_hannover.shp", "hannover_ly")
#Process: Create Fishnet
outFeatureClass = r"D:\Users\ju\ers\result\hannover_fisch.shp"
cellSizeWidth = '200'
cellSizeHeight = '200'
templateExtent = r"D:\Users\ju\ers\de013l_hannover\de013l_hannover\de013l_hannover.shp"
arcpy.CreateFishnet_management(outFeatureClass, "", "", cellSizeWidth, cellSizeHeight, '0', '0', "", "NO_LABELS", templateExtent, "POLYGON")