<?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 Trouble passing coordinates to CreateFishnet_management in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/trouble-passing-coordinates-to-createfishnet/m-p/412629#M32472</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As part of a Python script I am trying to pass coordinates into CreateFishnet_management. According to the help file, the syntax for the origin coordinate should be '610433.5 4956420.5'; however, my code throws the following error: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Invalid value type for parameter origin_coord.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is part of my script &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
fcFishnet = "C:\\Users\\fastth\\Documents\\Projects\\Eau Claire\\SmallNetTest.shp"
xOrigin = 610433.5
yOrigin = 4956420.5
xOppositeCorner = 610484.5
yOppositeCorne = 4956480.5
plotWidth = 1.5
plotHeight = 5
units = "Feet"

originCoord = "'" + str(xOrigin) + " " + str(yOrigin) + "'"
print originCoord 
oppositeCoord = "'" + str(plotWidth) + " " + str(plotHeight) + "'"

#Create the fishnet
arcpy.CreateFishnet_management(fcFishnet, originCoord, originCoord, plotHeight, plotWidth, oppositeCoord, "NO_LABELS", "DEFAULT", "POLYGON")
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The print statement returns &lt;/SPAN&gt;&lt;STRONG&gt;'610433.5 4956420.5'&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried reversinig the use of single &amp;amp; double quotes to get &lt;/SPAN&gt;&lt;STRONG&gt;"610433.5 4956420.5"&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Finally I tried: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;originCoord = arcpy.Point(xOrigin,yOrigin) &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No luck.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(code [thread=48475]formatted[/thread])&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Aug 2013 19:46:29 GMT</pubDate>
    <dc:creator>TimFast</dc:creator>
    <dc:date>2013-08-21T19:46:29Z</dc:date>
    <item>
      <title>Trouble passing coordinates to CreateFishnet_management</title>
      <link>https://community.esri.com/t5/python-questions/trouble-passing-coordinates-to-createfishnet/m-p/412629#M32472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As part of a Python script I am trying to pass coordinates into CreateFishnet_management. According to the help file, the syntax for the origin coordinate should be '610433.5 4956420.5'; however, my code throws the following error: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Invalid value type for parameter origin_coord.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is part of my script &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
fcFishnet = "C:\\Users\\fastth\\Documents\\Projects\\Eau Claire\\SmallNetTest.shp"
xOrigin = 610433.5
yOrigin = 4956420.5
xOppositeCorner = 610484.5
yOppositeCorne = 4956480.5
plotWidth = 1.5
plotHeight = 5
units = "Feet"

originCoord = "'" + str(xOrigin) + " " + str(yOrigin) + "'"
print originCoord 
oppositeCoord = "'" + str(plotWidth) + " " + str(plotHeight) + "'"

#Create the fishnet
arcpy.CreateFishnet_management(fcFishnet, originCoord, originCoord, plotHeight, plotWidth, oppositeCoord, "NO_LABELS", "DEFAULT", "POLYGON")
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The print statement returns &lt;/SPAN&gt;&lt;STRONG&gt;'610433.5 4956420.5'&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried reversinig the use of single &amp;amp; double quotes to get &lt;/SPAN&gt;&lt;STRONG&gt;"610433.5 4956420.5"&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Finally I tried: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;originCoord = arcpy.Point(xOrigin,yOrigin) &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No luck.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(code [thread=48475]formatted[/thread])&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2013 19:46:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trouble-passing-coordinates-to-createfishnet/m-p/412629#M32472</guid>
      <dc:creator>TimFast</dc:creator>
      <dc:date>2013-08-21T19:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble passing coordinates to CreateFishnet_management</title>
      <link>https://community.esri.com/t5/python-questions/trouble-passing-coordinates-to-createfishnet/m-p/412630#M32473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You are packing extra quotes inside your string that should just contain your two numbers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;originCoord = str(xOrigin) + " " + str(yOrigin)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or (better)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;originCoord = "{0} {1}".format(xOrigin, yOrigin)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Point would have worked except perhaps its string representation doesn't work here, as the point has X,Y,Z and M. This sure looks like a bug as the tool is supposed to be okay with Point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;gt;&amp;gt;&amp;gt; print arcpy.Point(0,0)
0 0 NaN NaN
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:43:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trouble-passing-coordinates-to-createfishnet/m-p/412630#M32473</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T18:43:38Z</dc:date>
    </item>
  </channel>
</rss>

