<?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: no message for addMessage in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/no-message-for-addmessage/m-p/384498#M30313</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Elaine,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Because your addMessage &amp;amp; print statements are indented, they are being executed during each iteration of the for loop. Remove the indent, and they will only execute at the conclusion of the script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The most likely reason no messages are being displayed is that no errors are occurring. Level 0 messages are normal, level 1 messages are warnings, and level 2 messages are critical errors. If you want to see all messages that occurred during the script, remove the error level: gp.getmessages().&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 May 2012 17:54:02 GMT</pubDate>
    <dc:creator>BruceNielsen</dc:creator>
    <dc:date>2012-05-12T17:54:02Z</dc:date>
    <item>
      <title>no message for addMessage</title>
      <link>https://community.esri.com/t5/python-questions/no-message-for-addmessage/m-p/384497#M30312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;System ArcGIS 9.3&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Problem 1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;No message jumped out when finishing running addMessage in the code below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please kindly advise any modification to show the message.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;##Script Name: Multi centroid&amp;nbsp; ##Description: Get centroid of shapefiles ##Created By: Elaine Kuo ##Date: 29/04/2012&amp;nbsp;&amp;nbsp; #Import standard library modules import arcgisscripting import os&amp;nbsp; #Create the Geoprocessor object gp = arcgisscripting.create(9.3)&amp;nbsp; #Set the input workspace #GP.workspace = sys.argv[1] #Set the workspace. gp.Workspace= "G:/temp/test1"&amp;nbsp; #Set the output workspace #outWorkspace = sys.argv[2] #Set the workspace. List all of the feature classes in the dataset outWorkspace= "G:/temp"&amp;nbsp;&amp;nbsp; # Create a list of all the features within the workspace. fcs = gp.ListFeatureClasses()&amp;nbsp; # Loop through every item in the list that was just generated for fc in fcs:&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Break out the name, no path or extension, using the describe object. &amp;nbsp;&amp;nbsp;&amp;nbsp; desc = gp.describe(fc) &amp;nbsp;&amp;nbsp;&amp;nbsp; featureName = desc.name&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Work the magic. &amp;nbsp;&amp;nbsp;&amp;nbsp; outFeatureClass = outWorkspace + os.sep + gp.ValidateTableName(featureName, outWorkspace) &amp;nbsp;&amp;nbsp;&amp;nbsp; gp.Toolbox = "Data Management" &amp;nbsp;&amp;nbsp;&amp;nbsp; gp.FeaturetoPoint(fc, outFeatureClass)&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddMessage(gp.GetMessages(2)) &amp;nbsp;&amp;nbsp;&amp;nbsp; print gp.GetMessages(2) &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2012 22:05:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/no-message-for-addmessage/m-p/384497#M30312</guid>
      <dc:creator>ElaineKuo</dc:creator>
      <dc:date>2012-05-11T22:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: no message for addMessage</title>
      <link>https://community.esri.com/t5/python-questions/no-message-for-addmessage/m-p/384498#M30313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Elaine,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Because your addMessage &amp;amp; print statements are indented, they are being executed during each iteration of the for loop. Remove the indent, and they will only execute at the conclusion of the script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The most likely reason no messages are being displayed is that no errors are occurring. Level 0 messages are normal, level 1 messages are warnings, and level 2 messages are critical errors. If you want to see all messages that occurred during the script, remove the error level: gp.getmessages().&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 May 2012 17:54:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/no-message-for-addmessage/m-p/384498#M30313</guid>
      <dc:creator>BruceNielsen</dc:creator>
      <dc:date>2012-05-12T17:54:02Z</dc:date>
    </item>
  </channel>
</rss>

