<?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: Batch Project and Copy Features - problem converting from 9.3 (arcscripting) to 1 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/batch-project-and-copy-features-problem-converting/m-p/602619#M47102</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No such thing as "import arcpy" is fairly troubling. Try opening IDLE and input help("arcpy"). Should come up with all the information on the module, file location etc. You mentioned previously using 9.3, did you cleanly remove all elements of 9.3 prior to installing 10 on your machine? Python 2.5 as well as Arc 9.3?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you post the actual error message you are getting?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Jan 2012 13:27:21 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2012-01-18T13:27:21Z</dc:date>
    <item>
      <title>Batch Project and Copy Features - problem converting from 9.3 (arcscripting) to 10</title>
      <link>https://community.esri.com/t5/python-questions/batch-project-and-copy-features-problem-converting/m-p/602618#M47101</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;I have this following script that I am trying to test out using IDLE 2.6.5. Notably, I've had a very similar script run before using Arc 9.3...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I'd like to do:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Write a script that looks into a directory, creates a list of shapefiles, and from this list batch projects all the shapefiles in the directory into a specific gdb (i.e. always to be named 'input.gdb'...there is one already existing in each directory). Output feature classes will have a specific name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) I would like to be able to use the script in model builder and make the directory user defined (i.e. variable folder in the below script) will be sys.argv(1). A little uncertain how to do this..but theoretically makes sense, right?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3) I am fine hard-coding the search pattern with a wildcard..."*.shp"...mostly because I doubt some of my users will know what a wildcard is... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SO far my script looks as thus:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;##Convert and reporoject shapefiles from RR_Sierra_Nevada\Forests
## Import modules and create geoprocessor object

import arcpy
import os
import fnmatch
import sys
import string

# Set the workspace. List all of the shapefiles


# input workspace

arcpy.env.workspace = r"D:\RR_Sierra_Nevada"

# returns a list of shapefiles in the specified folder
# that match the specified wildcard search pattern

folder =r"D:\RR_Sierra_Nevada\Forests\Inyo"
pattern = "*.shp"
shpList = []

for path, dirs, files in os.walk(folder):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for filename in fnmatch.filter(files, pattern):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; shpList.append(os.path.join(path, filename))

arcpy.AddMessage("Shapefiles returned:")
for shp in shpList:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(shp)

print shp&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error I keep getting is EITHER a blank return...or there is no such thing as 'import arcpy' (?).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 02:15:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-project-and-copy-features-problem-converting/m-p/602618#M47101</guid>
      <dc:creator>ArielleSimmons</dc:creator>
      <dc:date>2012-01-18T02:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Project and Copy Features - problem converting from 9.3 (arcscripting) to 1</title>
      <link>https://community.esri.com/t5/python-questions/batch-project-and-copy-features-problem-converting/m-p/602619#M47102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No such thing as "import arcpy" is fairly troubling. Try opening IDLE and input help("arcpy"). Should come up with all the information on the module, file location etc. You mentioned previously using 9.3, did you cleanly remove all elements of 9.3 prior to installing 10 on your machine? Python 2.5 as well as Arc 9.3?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you post the actual error message you are getting?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 13:27:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-project-and-copy-features-problem-converting/m-p/602619#M47102</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-01-18T13:27:21Z</dc:date>
    </item>
  </channel>
</rss>

