<?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 Python to create rectangle geometry works in 9.3.1, but doesn't work in 10.0 SP2 in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/python-to-create-rectangle-geometry-works-in-9-3-1/m-p/257657#M8835</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code at the bottom of the following thread works like a charm in 9.3.1....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.esri.com/thread.asp?t=280489&amp;amp;c=93&amp;amp;f=1729" rel="nofollow"&gt;http://forums.esri.com/thread.asp?t=280489&amp;amp;c=93&amp;amp;f=1729&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;... but it doesn't work in 10.0 SP2. In 10.0 SP2, the script executes, but the inserted row has no geometry. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've included my 10.0 SP2 code below. Anyone know how I can get this to work in 10?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Cory&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-family:&amp;quot;Courier New&amp;quot;;"&gt;# Import system modules&lt;BR /&gt;import sys, string, os, arcpy&lt;BR /&gt;&lt;BR /&gt;# Create the Geoprocessor object&lt;BR /&gt;ary = arcpy.CreateObject("Array")&lt;BR /&gt;pnt = arcpy.CreateObject("Point")&lt;BR /&gt;&lt;BR /&gt;## create rect starting lower right going clockwise&lt;BR /&gt;pnt.x = -117.0&lt;BR /&gt;pnt.y = 35&lt;BR /&gt;ary.add(pnt)&lt;BR /&gt;&lt;BR /&gt;pnt.x = -117.0&lt;BR /&gt;pnt.y = 35.75&lt;BR /&gt;ary.add(pnt)&lt;BR /&gt;&lt;BR /&gt;pnt.x = -116.25&lt;BR /&gt;pnt.y = 35.75&lt;BR /&gt;ary.add(pnt)&lt;BR /&gt;&lt;BR /&gt;pnt.x = -116.25&lt;BR /&gt;pnt.y = 35 &lt;BR /&gt;ary.add(pnt)&lt;BR /&gt;&lt;BR /&gt;## redo first point (lower right)&lt;BR /&gt;pnt.x = -117.0&lt;BR /&gt;pnt.y = 35&lt;BR /&gt;ary.add(pnt)&lt;BR /&gt;## -------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;AOI = "C:\\Temp\\test7.shp"&lt;BR /&gt;ScratchWS = "C:\\Temp"&lt;BR /&gt;&lt;BR /&gt;# Process: Create AOI Feature Class...&lt;BR /&gt;arcpy.CreateFeatureclass_management(ScratchWS, "test7", "POLYGON", "", "DISABLED", "DISABLED", "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];IsHighPrecision", "", "0", "0", "0")&lt;BR /&gt;cur = arcpy.InsertCursor(AOI)&lt;BR /&gt;feat = cur.newRow()&lt;BR /&gt;feat.shape = ary&lt;BR /&gt;cur.insertRow(feat)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jun 2011 17:42:43 GMT</pubDate>
    <dc:creator>deleted-user-Ohz6rwd1kavx</dc:creator>
    <dc:date>2011-06-20T17:42:43Z</dc:date>
    <item>
      <title>Python to create rectangle geometry works in 9.3.1, but doesn't work in 10.0 SP2</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-to-create-rectangle-geometry-works-in-9-3-1/m-p/257657#M8835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code at the bottom of the following thread works like a charm in 9.3.1....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.esri.com/thread.asp?t=280489&amp;amp;c=93&amp;amp;f=1729" rel="nofollow"&gt;http://forums.esri.com/thread.asp?t=280489&amp;amp;c=93&amp;amp;f=1729&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;... but it doesn't work in 10.0 SP2. In 10.0 SP2, the script executes, but the inserted row has no geometry. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've included my 10.0 SP2 code below. Anyone know how I can get this to work in 10?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Cory&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-family:&amp;quot;Courier New&amp;quot;;"&gt;# Import system modules&lt;BR /&gt;import sys, string, os, arcpy&lt;BR /&gt;&lt;BR /&gt;# Create the Geoprocessor object&lt;BR /&gt;ary = arcpy.CreateObject("Array")&lt;BR /&gt;pnt = arcpy.CreateObject("Point")&lt;BR /&gt;&lt;BR /&gt;## create rect starting lower right going clockwise&lt;BR /&gt;pnt.x = -117.0&lt;BR /&gt;pnt.y = 35&lt;BR /&gt;ary.add(pnt)&lt;BR /&gt;&lt;BR /&gt;pnt.x = -117.0&lt;BR /&gt;pnt.y = 35.75&lt;BR /&gt;ary.add(pnt)&lt;BR /&gt;&lt;BR /&gt;pnt.x = -116.25&lt;BR /&gt;pnt.y = 35.75&lt;BR /&gt;ary.add(pnt)&lt;BR /&gt;&lt;BR /&gt;pnt.x = -116.25&lt;BR /&gt;pnt.y = 35 &lt;BR /&gt;ary.add(pnt)&lt;BR /&gt;&lt;BR /&gt;## redo first point (lower right)&lt;BR /&gt;pnt.x = -117.0&lt;BR /&gt;pnt.y = 35&lt;BR /&gt;ary.add(pnt)&lt;BR /&gt;## -------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;AOI = "C:\\Temp\\test7.shp"&lt;BR /&gt;ScratchWS = "C:\\Temp"&lt;BR /&gt;&lt;BR /&gt;# Process: Create AOI Feature Class...&lt;BR /&gt;arcpy.CreateFeatureclass_management(ScratchWS, "test7", "POLYGON", "", "DISABLED", "DISABLED", "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];IsHighPrecision", "", "0", "0", "0")&lt;BR /&gt;cur = arcpy.InsertCursor(AOI)&lt;BR /&gt;feat = cur.newRow()&lt;BR /&gt;feat.shape = ary&lt;BR /&gt;cur.insertRow(feat)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 17:42:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-to-create-rectangle-geometry-works-in-9-3-1/m-p/257657#M8835</guid>
      <dc:creator>deleted-user-Ohz6rwd1kavx</dc:creator>
      <dc:date>2011-06-20T17:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Python to create rectangle geometry works in 9.3.1, but doesn't work in 10.0 SP2</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-to-create-rectangle-geometry-works-in-9-3-1/m-p/257658#M8836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Cory,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See amended code and my notes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Import system modules
import sys, string, os, arcpy

# Create the Geoprocessor object
# NOTE: DO NOT USE CREATEOBJECT METHOD
ary = arcpy.Array()
pnt = arcpy.Point()

## create rect starting lower right going clockwise
# NOTE: THE x &amp;amp; y PROPERTY ARE IN CAPITALS
pnt.X = -117.0
pnt.Y = 35
ary.add(pnt)

pnt.X = -117.0
pnt.Y = 35.75
ary.add(pnt)

pnt.X = -116.25
pnt.Y = 35.75
ary.add(pnt)

pnt.X = -116.25
pnt.Y = 35 
ary.add(pnt)

## redo first point (lower right)
pnt.X = -117.0
pnt.Y = 35
ary.add(pnt)

## -------------------------------------------------------------

AOI = "C:\\Temp\\test9.shp"
ScratchWS = "C:\\Temp"

# Process: Create AOI Feature Class...
arcpy.CreateFeatureclass_management(ScratchWS, "test9", "POLYGON", "", "DISABLED", "DISABLED", "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];IsHighPrecision", "", "0", "0", "0")
cur = arcpy.InsertCursor(AOI)
feat = cur.newRow()
feat.shape = ary
cur.insertRow(feat)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:41:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-to-create-rectangle-geometry-works-in-9-3-1/m-p/257658#M8836</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-11T12:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Python to create rectangle geometry works in 9.3.1, but doesn't work in 10.0 SP2</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-to-create-rectangle-geometry-works-in-9-3-1/m-p/257659#M8837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Duncan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Huge thanks sir.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I made the recommended adjustments to my script, and it now runs flawlessly in 10.0 SP2.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Not &lt;/STRONG&gt;&lt;SPAN&gt; using CreateObject seemed to be the trick.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Cory&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2011 17:29:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-to-create-rectangle-geometry-works-in-9-3-1/m-p/257659#M8837</guid>
      <dc:creator>deleted-user-Ohz6rwd1kavx</dc:creator>
      <dc:date>2011-06-23T17:29:42Z</dc:date>
    </item>
  </channel>
</rss>

