<?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 clip nothing in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/clip-nothing/m-p/680110#M52696</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcgisscripting, sys, string, os
gp = arcgisscripting.create(9.3)
gp.OverWriteOutput = 1

FCsToClip = sys.argv[1]
FCClip = sys.argv[2]
outDir = sys.argv[3]

uniq = 9000
cur = gp.SearchCursor(FCClip)
row = cur.Next()
while row:
&amp;nbsp;&amp;nbsp;&amp;nbsp; DDAbb=row.getValue("ABBREVIATION")
&amp;nbsp;&amp;nbsp;&amp;nbsp; feat = row.shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; DDAbb_=DDAbb.replace (" ", "_")
&amp;nbsp;&amp;nbsp;&amp;nbsp; if not gp.Exists(outDir+"\\"+DDAbb_):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.Clip_analysis(FCsToClip, feat, outDir+"\\"+DDAbb.replace (" ", "_"))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addMessage(DDAbb.replace (" ", "_"))
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.Clip_analysis(FCsToClip, feat, outDir+"\\"+DDAbb.replace (" ", "_")+"_"+str(uniq))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uniq+=1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addMessage(DDAbb.replace (" ", "_")+"_"+str(uniq))
&amp;nbsp;&amp;nbsp;&amp;nbsp; row = cur.Next()&amp;nbsp; 
del cur, row&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Dan Patterson
I provided python syntax highlighting to make it easier to read&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 04:38:36 GMT</pubDate>
    <dc:creator>KevinLam</dc:creator>
    <dc:date>2021-12-12T04:38:36Z</dc:date>
    <item>
      <title>clip nothing</title>
      <link>https://community.esri.com/t5/python-questions/clip-nothing/m-p/680110#M52696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcgisscripting, sys, string, os
gp = arcgisscripting.create(9.3)
gp.OverWriteOutput = 1

FCsToClip = sys.argv[1]
FCClip = sys.argv[2]
outDir = sys.argv[3]

uniq = 9000
cur = gp.SearchCursor(FCClip)
row = cur.Next()
while row:
&amp;nbsp;&amp;nbsp;&amp;nbsp; DDAbb=row.getValue("ABBREVIATION")
&amp;nbsp;&amp;nbsp;&amp;nbsp; feat = row.shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; DDAbb_=DDAbb.replace (" ", "_")
&amp;nbsp;&amp;nbsp;&amp;nbsp; if not gp.Exists(outDir+"\\"+DDAbb_):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.Clip_analysis(FCsToClip, feat, outDir+"\\"+DDAbb.replace (" ", "_"))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addMessage(DDAbb.replace (" ", "_"))
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.Clip_analysis(FCsToClip, feat, outDir+"\\"+DDAbb.replace (" ", "_")+"_"+str(uniq))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uniq+=1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addMessage(DDAbb.replace (" ", "_")+"_"+str(uniq))
&amp;nbsp;&amp;nbsp;&amp;nbsp; row = cur.Next()&amp;nbsp; 
del cur, row&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Dan Patterson
I provided python syntax highlighting to make it easier to read&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:38:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clip-nothing/m-p/680110#M52696</guid>
      <dc:creator>KevinLam</dc:creator>
      <dc:date>2021-12-12T04:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: clip nothing</title>
      <link>https://community.esri.com/t5/python-questions/clip-nothing/m-p/680111#M52697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Provide some print statements to check on progress.&amp;nbsp; Was "while" supported in 9.3?.&amp;nbsp; Check the help topics for previous versions and in particular to the version 10.0 and 10.1 ... there is a statement there about the evolution of cursors in arcmap and the change in how they are dealt with respect to python&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 08:45:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clip-nothing/m-p/680111#M52697</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-25T08:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: clip nothing</title>
      <link>https://community.esri.com/t5/python-questions/clip-nothing/m-p/680112#M52698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you getting any error messages, or are the results just empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the results are just empty, make sure all feature classes involved in the clip are in the same projection and the same extent. Do not just assume they are because they may draw in ArcMap, since ArcMap will project-on-the-fly if the layers have valid coordinate systems associated with them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as Dan mention, if in version 10.x or newer, you may want to look into using the arcpy module instead of gp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit...adding a few arcpy help doc links for 10.2&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//002z00000008000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//002z00000008000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Importing Arcpy&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//000800000004000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//000800000004000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt;&amp;nbsp;&amp;nbsp; Clip, including sample script &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 12:33:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clip-nothing/m-p/680112#M52698</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-01-25T12:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: clip nothing</title>
      <link>https://community.esri.com/t5/python-questions/clip-nothing/m-p/680113#M52699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your variable name indicates you may be passing a list of FCs to the clip tool, it can only clip 1 fc at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;FCsToClip&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;gt; FCtoClip&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 16:09:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clip-nothing/m-p/680113#M52699</guid>
      <dc:creator>LukeWebb</dc:creator>
      <dc:date>2016-01-25T16:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: clip nothing</title>
      <link>https://community.esri.com/t5/python-questions/clip-nothing/m-p/680114#M52700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you Clip using a geometry? If not you may need to use arcpy.CopyFeatures_management and create a in_memory featureclass to use in the Clip tool.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 16:54:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clip-nothing/m-p/680114#M52700</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2016-01-25T16:54:20Z</dc:date>
    </item>
  </channel>
</rss>

