<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Creating fishnet using a template in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/creating-fishnet-using-a-template/m-p/1335975#M68878</link>
    <description>&lt;P&gt;It looks like you have to get the origin from the template featureclass then&lt;/P&gt;</description>
    <pubDate>Fri, 06 Oct 2023 21:04:31 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2023-10-06T21:04:31Z</dc:date>
    <item>
      <title>Creating fishnet using a template</title>
      <link>https://community.esri.com/t5/python-questions/creating-fishnet-using-a-template/m-p/1335252#M68848</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I need some help to work out how to configure create fishnet using a template specified in the parameter of a script tool to create a 2m grid. Im not sure how to get the x and Y values from the template. Thank you for your help its very apprecaited&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Output1 = arcpy.GetParameterAsText(0)
Input1 = arcpy.GetParameterAsText(1)

arcpy.management.CreateFishnet(Output1,"","" , '2', '2',None,None,"", "NO_LABELS", Input 1, "POLYGON")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 02:41:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-fishnet-using-a-template/m-p/1335252#M68848</guid>
      <dc:creator>JasmineSpring</dc:creator>
      <dc:date>2023-10-05T02:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating fishnet using a template</title>
      <link>https://community.esri.com/t5/python-questions/creating-fishnet-using-a-template/m-p/1335266#M68850</link>
      <description>&lt;P&gt;why not add another parameter and set its default value&lt;/P&gt;&lt;P&gt;size - arcpy.GetParameterAsText(2)&lt;/P&gt;&lt;P&gt;arcpy.management.CreateFishnet(Output1,"","" , size, size,None,None,"", "NO_LABELS", Input 1, "POLYGON")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 07:42:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-fishnet-using-a-template/m-p/1335266#M68850</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-10-05T07:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating fishnet using a template</title>
      <link>https://community.esri.com/t5/python-questions/creating-fishnet-using-a-template/m-p/1335664#M68873</link>
      <description>&lt;P&gt;The size is ok because it is always 2m. It is using the template (another layer) set as a parameter that is the issue when its scripted in python.&amp;nbsp; I get the following error.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JasmineSpring_0-1696562434765.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/82452i534C23E52E3F6C6C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JasmineSpring_0-1696562434765.png" alt="JasmineSpring_0-1696562434765.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 03:21:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-fishnet-using-a-template/m-p/1335664#M68873</guid>
      <dc:creator>JasmineSpring</dc:creator>
      <dc:date>2023-10-06T03:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Creating fishnet using a template</title>
      <link>https://community.esri.com/t5/python-questions/creating-fishnet-using-a-template/m-p/1335975#M68878</link>
      <description>&lt;P&gt;It looks like you have to get the origin from the template featureclass then&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 21:04:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-fishnet-using-a-template/m-p/1335975#M68878</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-10-06T21:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Creating fishnet using a template</title>
      <link>https://community.esri.com/t5/python-questions/creating-fishnet-using-a-template/m-p/1339888#M69001</link>
      <description>&lt;P&gt;This is the solution I used in the end&lt;/P&gt;&lt;LI-CODE lang="c"&gt;desc = arcpy.Describe(Templatelayer)
arcpy.CreateFishnet_management(Grid_layer,str(desc.extent.lowerLeft),str(desc.extent.XMin) + " " + str(desc.extent.YMax),"2","2",None,None,str(desc.extent.upperRight),"NO_LABELS","#","POLYGON")&lt;/LI-CODE&gt;&lt;P&gt;. Thank you for your help&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 03:11:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-fishnet-using-a-template/m-p/1339888#M69001</guid>
      <dc:creator>JasmineSpring</dc:creator>
      <dc:date>2023-10-20T03:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating fishnet using a template</title>
      <link>https://community.esri.com/t5/python-questions/creating-fishnet-using-a-template/m-p/1507801#M71101</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/642359"&gt;@JasmineSpring&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Sorry I am very late to this and know its solved but a similar solution from me.&amp;nbsp; I am only interested in making 2 rows and 4 columns but here is the code for what it is worth.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
import os

wksp = r"Insert workspace here"
in_md = "Insert name of input dataset"
out_fc = "Insert name output feature class"

arcpy.env.workspace = wksp

# Create a fishnet grid
desc = arcpy.Describe(in_md)
xmin = desc.extent.XMin
xmax = desc.extent.XMax
ymin = desc.extent.YMin
ymax = desc.extent.YMax

point_origin = f'{xmin} {ymin}'
point_yaxis = f'{xmin} {ymax}'

arcpy.CreateFishnet_management(out_feature_class=out_fc,
                               origin_coord=point_origin,
                               y_axis_coord=point_yaxis,
                               number_rows="2",
                               number_columns="4",
                               labels="NO_LABELS",
                               template=in_md,
                               geometry_type="POLYGON")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2024 04:06:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-fishnet-using-a-template/m-p/1507801#M71101</guid>
      <dc:creator>NickAtEsriAU</dc:creator>
      <dc:date>2024-07-22T04:06:55Z</dc:date>
    </item>
  </channel>
</rss>

