<?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: Get vertices of a graphic polygon in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/get-vertices-of-a-graphic-polygon/m-p/22272#M1716</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The standard tool interface has a feature type called 'featureset' (in the dropdown list that has featureclass, layer, string...)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This enables you to sketch a graphic on the screen that is passed into the script as a parameter. The input parameter needs a layer template set to use as a symbol reference and to define the shape type : point, line or polygon and any attributes required.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you start the tool (by opening the dialog) you can draw some features and even fill in some attributes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my script example I create a featureset called 'mpa' in my script and then save it to a featureclass after updating the ID. i then use it to clip some layers and run statistics.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//002w00000080000000"&gt;online help reference&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While you could at 10.1 use Add-Ins to track the mouse, it is overkill if you just want to enter a simple polygon, line or a set of points interactively.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 06 Apr 2013 22:44:46 GMT</pubDate>
    <dc:creator>KimOllivier</dc:creator>
    <dc:date>2013-04-06T22:44:46Z</dc:date>
    <item>
      <title>Get vertices of a graphic polygon</title>
      <link>https://community.esri.com/t5/python-questions/get-vertices-of-a-graphic-polygon/m-p/22268#M1712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I wish to sketch a polygon (graphic drawing) on the screen, and then get the vertices of that polygon into a table for use as input in a different software tool. Is this possible?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 14:24:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-vertices-of-a-graphic-polygon/m-p/22268#M1712</guid>
      <dc:creator>JimCousins</dc:creator>
      <dc:date>2012-05-16T14:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Get vertices of a graphic polygon</title>
      <link>https://community.esri.com/t5/python-questions/get-vertices-of-a-graphic-polygon/m-p/22269#M1713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I do not believe arcpy has access to graphics in ArcGIS 10. ArcObjects could do this for you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 15:14:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-vertices-of-a-graphic-polygon/m-p/22269#M1713</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-05-16T15:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get vertices of a graphic polygon</title>
      <link>https://community.esri.com/t5/python-questions/get-vertices-of-a-graphic-polygon/m-p/22270#M1714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can interactively create a sketch in a tool using a featureset type.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is then passed into the script as a feature which you can manipulate just like any other feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is an example where I get a polygon drawn in ArcMap, get an autoincrement number and write it out to a featureclass.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is available from 9.3+&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mpa = gp.GetParameter(0)
# get the id and name from first record if set
cur = gp.SearchCursor(mpa)
row = cur.next()
MPAName = row.MPAName
mpaid = row.mpaid
del row,cur

if MPAName == None and mpaid == None :
&amp;nbsp;&amp;nbsp;&amp;nbsp; MPAName = "MPA" 
&amp;nbsp;&amp;nbsp;&amp;nbsp; mpaid = 0
elif mpaid &amp;gt; 0 and MPAName == None:
&amp;nbsp;&amp;nbsp;&amp;nbsp; MPAName = "MPA"+str(mpaid)
elif mpaid == None and MPAName != None :
&amp;nbsp;&amp;nbsp;&amp;nbsp; # keep override name
&amp;nbsp;&amp;nbsp;&amp;nbsp; mpaid = int(MPAName[3:])
else :
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddWarning(MPAName)
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddWarning(mpaid)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
# rename all parts with a unique name for a dissolve
# increments to highest number or blank or zero
if not gp.Exists("MPA") :
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.CopyFeatures("template_mpa","MPA")
if not gp.Exists("MPA0") :
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.CopyFeatures("template_mpa","MPA0")&amp;nbsp;&amp;nbsp;&amp;nbsp; 
fcName = gp.CreateUniqueName(MPAName,ws)
fcName = os.path.basename(fcName)
MPAName = fcName # update
mpaid = int(MPAName[3:])
## gp.AddWarning(str(mpaid)+" "+MPAName)
cur = gp.UpdateCursor(mpa)
row = cur.next()
while row:
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.MPAName = fcName
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.mpaid = mpaid
&amp;nbsp;&amp;nbsp;&amp;nbsp; cur.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp; row = cur.next()
del row,cur
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:54:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-vertices-of-a-graphic-polygon/m-p/22270#M1714</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2021-12-10T20:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Get vertices of a graphic polygon</title>
      <link>https://community.esri.com/t5/python-questions/get-vertices-of-a-graphic-polygon/m-p/22271#M1715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Kim, I haven't finished my research on this yet, surprised I haven't looked at this before....can you elaborate further on how this is done?&amp;nbsp; How to accept input interactively and commit a few vertices to a polygon (or line), say, while executing a tool.&amp;nbsp; I need something where a user interacts with selected polys on screen where I will attempt to capture via their sketch where they'd like to clip one or more of the selected polygons.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this my understanding of what is possible?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Enjoy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Apr 2013 18:25:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-vertices-of-a-graphic-polygon/m-p/22271#M1715</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-04-05T18:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Get vertices of a graphic polygon</title>
      <link>https://community.esri.com/t5/python-questions/get-vertices-of-a-graphic-polygon/m-p/22272#M1716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The standard tool interface has a feature type called 'featureset' (in the dropdown list that has featureclass, layer, string...)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This enables you to sketch a graphic on the screen that is passed into the script as a parameter. The input parameter needs a layer template set to use as a symbol reference and to define the shape type : point, line or polygon and any attributes required.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you start the tool (by opening the dialog) you can draw some features and even fill in some attributes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my script example I create a featureset called 'mpa' in my script and then save it to a featureclass after updating the ID. i then use it to clip some layers and run statistics.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//002w00000080000000"&gt;online help reference&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While you could at 10.1 use Add-Ins to track the mouse, it is overkill if you just want to enter a simple polygon, line or a set of points interactively.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Apr 2013 22:44:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-vertices-of-a-graphic-polygon/m-p/22272#M1716</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2013-04-06T22:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Get vertices of a graphic polygon</title>
      <link>https://community.esri.com/t5/python-questions/get-vertices-of-a-graphic-polygon/m-p/22273#M1717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Kim, thank you very much, I can't wait to experiment further with this tomorrow, think it's just the ticket.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pretty interesting, I like the 'lightweight' quality of it as well, with no particularly special added considerations for distribution...other than where to write 'scratch' results which I am hoping I can set as 'relative-pathed' or check via script the scratch env var (if there is such a thing), processing as quickly as possible on the local user machine (not the server).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I too have experienced problems with in_memory workspace and am intrigued by your related posts concerning in_memory workarounds without noticably sacrificing performance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again and cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Apr 2013 15:33:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/get-vertices-of-a-graphic-polygon/m-p/22273#M1717</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-04-07T15:33:34Z</dc:date>
    </item>
  </channel>
</rss>

