<?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: ArcGIS 10 Batch Clip in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/arcgis-10-batch-clip/m-p/648725#M21694</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A group of genius:D&lt;/SPAN&gt;&lt;IMG src="http://www.infoocean.info/avatar2.jpg" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Mar 2012 00:33:29 GMT</pubDate>
    <dc:creator>ConstanceDavisson</dc:creator>
    <dc:date>2012-03-22T00:33:29Z</dc:date>
    <item>
      <title>ArcGIS 10 Batch Clip</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcgis-10-batch-clip/m-p/648720#M21689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm new to python and just upgraded ArcGIS 10. I've been experimenting with python and I'm trying to batch clip several layers in ArcMaps TOC. The number of layers can change depending on the user.&amp;nbsp; The script runs without any errors, however nothing happens. I can make a clip of a single layer based on another layer work, but when I change the code and try to implement a loop to batch the process I'm getting stuck. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here's my code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy.mapping&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Analysis Tools.tbx")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;clip = arcpy.GetParameterAsText(0) # input, required, single value&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outFC = arcpy.GetParameterAsText(1) # output, required, single value&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;toclip = arcpy.mapping.MapDocument("Current")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df = arcpy.mapping.ListLayers(toclip)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fcs = arcpy.mapping.ListLayers(toclip)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fcs.Reset()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fc = fcs.Next()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while fc:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFeatureClass = outFC +"/" + arcpy.ValidateTableName(fc, outFC)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_analysis(fc, clip, outFeatureClass, "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fc = fcs.Next()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;except:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.GetMessages(2) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 19:32:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcgis-10-batch-clip/m-p/648720#M21689</guid>
      <dc:creator>JoshuaFerguson</dc:creator>
      <dc:date>2010-11-05T19:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 10 Batch Clip</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcgis-10-batch-clip/m-p/648721#M21690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;By chance did you find an answer to your problem?&amp;nbsp; I am trying to do the same thing or at least batch clip selected feature classes by a single polygon shapefile.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I had VBA code that did this for me, but I need to now use python.&amp;nbsp; I will admit I am a python newbie.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help or advice appreciated,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Amy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2012 13:16:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcgis-10-batch-clip/m-p/648721#M21690</guid>
      <dc:creator>AmyRose</dc:creator>
      <dc:date>2012-03-14T13:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 10 Batch Clip</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcgis-10-batch-clip/m-p/648722#M21691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Rather than reinvent the wheel, why not just right-click the Clip tool, choose Batch, and drag and drop what you need?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;edit: if you've got your heart set on using, or have a reason to use, Python, reply.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2012 15:16:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcgis-10-batch-clip/m-p/648722#M21691</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2012-03-14T15:16:15Z</dc:date>
    </item>
    <item>
      <title>ArcGIS 10 Batch Clip</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcgis-10-batch-clip/m-p/648723#M21692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not too long ago, I created a custom model that can clip an entire workspace:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Workspace Clip&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=F9507173-1422-2418-7FC3-DC15A7655077"&gt;http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=F9507173-1422-2418-7FC3-DC15A7655077&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;"This model extracts a specific geography, and then clips an entire workspace to a specified directory. This model is useful for quickly clipping an entire workspace (folder, geodatabase, or feature dataset). SQL query statements (optional) make it easy to define the constraining geography without having to extract it to a new file first. The model also uses inline variable substitution to ensure that the output filenames can be quickly recognized after the process completes. "&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course, there may be other reasons you specifically want to use Python.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2012 19:45:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcgis-10-batch-clip/m-p/648723#M21692</guid>
      <dc:creator>DennisJarrard</dc:creator>
      <dc:date>2012-03-19T19:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 10 Batch Clip</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcgis-10-batch-clip/m-p/648724#M21693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We can't check your loop unless you [thread=48475]post your code in a code block![/thread] Python indentation is significant!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2012 21:34:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcgis-10-batch-clip/m-p/648724#M21693</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2012-03-19T21:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 10 Batch Clip</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcgis-10-batch-clip/m-p/648725#M21694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A group of genius:D&lt;/SPAN&gt;&lt;IMG src="http://www.infoocean.info/avatar2.jpg" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2012 00:33:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcgis-10-batch-clip/m-p/648725#M21694</guid>
      <dc:creator>ConstanceDavisson</dc:creator>
      <dc:date>2012-03-22T00:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 10 Batch Clip</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcgis-10-batch-clip/m-p/648726#M21695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use this as a toolbox script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.env.overwriteOutput = True
input = arcpy.GetParameterAsText(0)
clipfeature = arcpy.GetParameterAsText(1)
output = arcpy.GetParameterAsText(2)
arcpy.env.workspace = output
inputSp = input.split(";")
for i in inputSp:

&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(i)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_analysis(i, clipfeature, i)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:30:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcgis-10-batch-clip/m-p/648726#M21695</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2021-12-12T03:30:11Z</dc:date>
    </item>
  </channel>
</rss>

