2

This question already has an answer here:

I'm writing a python script that creates a fishnet in a specified area (parcel shapefile) that accepts user input to create a polygon shapefile that represents a building, and polyline shapefile that represent parking area in the parcel. In ArcMap, you're able to choose the optional parameter of "Template Extent" that automatically populates the Y-Axis, and Origin Coordinates that the tool requires. I keep getting this error when running my script:

ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000735: Fishnet Origin Coordinate : Value is required
ERROR 000735: Y-Axis Coordinate : Value is required
Failed to execute (CreateFishnet).

In my CreateFIshnet syntax, using "#" in the origin_coord and y_axis coord results in an error instead of passing the request to the optional {template}.

Is there a way around this? I'd like the optional {template} parameter to take priority, but I'm wondering if I have to create points within the specified area and pass those coordinates to the fishnet parameters?

marked as duplicate by PolyGeo Nov 17 '14 at 21:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Its always hard to advise on ArcPy code when a snippet is not included in a question.

However, I suspect that one of your variables is not set to what you think it is before using it within the CreateFishnet line of code.

For testing I recommend adding some print and/or arcpy.AddMessage lines to see their values.

Coming at it from another direction, I also recommend using Copy As Python Snippet from the Geoprocessing | Results window to grab the correct syntax it writes on a successful run of the Create Fishnet tool from its tool dialog. Having a working syntax to compare against can do wonders.

With respect to the optional {template} parameter that works so well on the Create Fishnet tool, this is because that system tool runs some tool validation code to calculate the relevant values. It is that code which I suspect you are trying, or need, to reproduce in your script.

Not the answer you're looking for? Browse other questions tagged or ask your own question.