<?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 Define projection with Python in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/batch-define-projection-with-python/m-p/259105#M6653</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Prior to 9.3 the ListFeatureClasses method returned an enumeration object. An enumeration requires that you call it's Next method to navigate through the values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At 9.3 the ListFeatureClasses method returns a Python list that you will be able to use in a for loop as in your sample code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would suggest that you change the following line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gp = arcgisscripting.create()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gp = arcgisscripting.create(9.3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See the following help documents for additional details.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Creating_the_geoprocessor_object&amp;amp;anchor=comparing_93_and_92_geoprocessors"&gt;Comparing 93 and 92 geoprocessors&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Differences_between_geoprocessor_versions"&gt;Differences between geoprocessor versions&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Sep 2010 04:00:32 GMT</pubDate>
    <dc:creator>JohnHauck</dc:creator>
    <dc:date>2010-09-23T04:00:32Z</dc:date>
    <item>
      <title>Batch Define projection with Python</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/batch-define-projection-with-python/m-p/259104#M6652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am fairly new to Python and I have been trying to make a script work-to assign a GC system to a number of shapefiles in a folder.(The GC system is currently Unknown so I cannot use the other tools in batch mode)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using Python 2.5 and Arc 9.3.1 but I keep getting errors &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;( for fc in fcS:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TypeError: 'geoprocessing list object' object is not iterable) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;that don't really tip me off about what it s going wrong (newbie)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My code is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcgisscripting&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp = arcgisscripting.create()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.workspace = "P:\Proj"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.toolbox = "management"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;coordsys = "Coordinate Systems/Projected Coordinate Systems/National Grids/British National Grid.prj"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fcs = gp.ListFeatureClasses() &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for fc in fcS:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.defineprojection(fcS, coordsys)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am certain there are a lot of errors there, but if anyone can assist with the iteration/listing of the shapefiles in the folder it would be great.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance for any suggestions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;S.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 14:48:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/batch-define-projection-with-python/m-p/259104#M6652</guid>
      <dc:creator>SofiaStouki</dc:creator>
      <dc:date>2010-09-22T14:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Define projection with Python</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/batch-define-projection-with-python/m-p/259105#M6653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Prior to 9.3 the ListFeatureClasses method returned an enumeration object. An enumeration requires that you call it's Next method to navigate through the values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At 9.3 the ListFeatureClasses method returns a Python list that you will be able to use in a for loop as in your sample code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would suggest that you change the following line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gp = arcgisscripting.create()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gp = arcgisscripting.create(9.3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See the following help documents for additional details.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Creating_the_geoprocessor_object&amp;amp;anchor=comparing_93_and_92_geoprocessors"&gt;Comparing 93 and 92 geoprocessors&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Differences_between_geoprocessor_versions"&gt;Differences between geoprocessor versions&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 04:00:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/batch-define-projection-with-python/m-p/259105#M6653</guid>
      <dc:creator>JohnHauck</dc:creator>
      <dc:date>2010-09-23T04:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Define projection with Python</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/batch-define-projection-with-python/m-p/259106#M6654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you for your reply. After getting feedback from the forum users and going through some articles, I managed to get my script to work. I have posted the details at the Functions-Geoprocessing forum &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/13474-Batch-define-projection-with-Python"&gt;http://forums.arcgis.com/threads/13474-Batch-define-projection-with-Python&lt;/A&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;S.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 11:16:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/batch-define-projection-with-python/m-p/259106#M6654</guid>
      <dc:creator>SofiaStouki</dc:creator>
      <dc:date>2010-09-23T11:16:40Z</dc:date>
    </item>
  </channel>
</rss>

