<?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: AddMessage question in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290717#M22529</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is kind of an important detail, easy to overlook, so I'm posting once more to clarify (hopefully).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since this was a file gdb (as hard-coded in the script) and using GetParameterAsText for the var LID to 'filter' the search cursor, this query should work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;rows = arcpy.SearchCursor("C:/Python/Python.gdb/Counties", "LINE_ID = '" + LID + "'")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There's more than 1 way to enter a query, but basically from the webhelp topic, Specifying a Query in Python (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/index.html#//002z0000001r000000" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//002z0000001r000000&lt;/A&gt;&lt;SPAN&gt;), a better recommended approach is something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;qry = """%s = '%s'""" % (arcpy.AddFieldDelimiters(fc, "LINE_ID"), LID)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rows = arcpy.SearchCursor("C:/Python/Python.gdb/Counties", qry)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that at least sums up better this rather lengthy thread --- for those still unsure what was happening, the incorrect query ("LINE_ID = 'LID'") was returning an empty set hence no messages...nothing to print.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Enjoy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 May 2013 19:15:51 GMT</pubDate>
    <dc:creator>T__WayneWhitley</dc:creator>
    <dc:date>2013-05-28T19:15:51Z</dc:date>
    <item>
      <title>AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290702#M22514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How would you do this using AddMessage instead of print and in a script tool? My code has a parameter and where_clause in the search cursor so the user inputs a name and I would like a message listing field values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ESRI expample:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy # Open a searchcursor #&amp;nbsp; Input: C:/Data/Counties.shp #&amp;nbsp; Fields: NAME; STATE_NAME; POP2000 #&amp;nbsp; Sort fields: STATE_NAME A; POP2000 D rows = arcpy.SearchCursor("c:/data/counties.shp", &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fields="NAME; STATE_NAME; POP2000", &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sort_fields="STATE_NAME A; POP2000 D")&amp;nbsp; # Iterate through the rows in the cursor and print out the # state name, county and population of each. for row in rows: &amp;nbsp;&amp;nbsp;&amp;nbsp; print("State: {0}, County: {1}, Population: {2}".format( &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.getValue("STATE_NAME"), &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.getValue("NAME"), &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.getValue("POP2000")))&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 20:03:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290702#M22514</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2013-05-24T20:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290703#M22515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;...for 'print' substitute 'arcpy.AddMessage' with the message enclosed in parenthesis.&amp;nbsp; Just make sure your indention is correct.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As in:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.AddMessage("State: {0}, County: {1}, Population: {2}".format(row.getValue("STATE_NAME"), row.getValue("NAME"), row.getValue("POP2000")))
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think that will work...test it out.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:01:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290703#M22515</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2021-12-11T14:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290704#M22516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I did try that but it will run the code but will ignore the "AddMessage"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 22:13:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290704#M22516</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2013-05-24T22:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290705#M22517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Any error messages?&amp;nbsp; ...you have to run this as a script tool via ArcGIS's toolbox to 'port' it to it's geoprocessor interface.&amp;nbsp; You don't have to define any parameters, but must display it's dialog window to see the returned messages - of course if erroring out before you get to the messages you've attempted to add, then you won't see them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the message itself is a problem, then try formatting the text before you add it to the AddMessage parameter...debatably easier to read the code that way anyway.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...as in:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
theMessage = "State: {0}, County: {1}, Population: {2}".format(row.getValue("STATE_NAME"), row.getValue("NAME"), row.getValue("POP2000"))
arcpy.AddMessage(theMessage)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Again, make sure you don't have an indention error earlier in the code block.&amp;nbsp; If you're still having problems, include more complete details what you are doing and any feedback messages.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:01:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290705#M22517</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2021-12-11T14:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290706#M22518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I took your advice and got it to work like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
LID = arcpy.GetParameterAsText(0)
rows = arcpy.SearchCursor("C:/Python/Python.gdb/Counties", "LINE_ID = 'LID'")
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.getValue(rows)
theMessage = "State: {0}, Name: {1} , Population: {2}".format(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.getValue("STATE_NAME"),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.getValue("NAME"),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.getValue("POP2000"))
arcpy.AddMessage(theMessage)
del rows, LID&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I needed to define "theMessage" without indentation and add row.getValue(rows) instead under "for row in rows".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;THANK YOU!!!!!!!!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:01:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290706#M22518</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2021-12-11T14:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290707#M22519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I took your advice and got it to work like this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
LID = arcpy.GetParameterAsText(0)
rows = arcpy.SearchCursor("C:/Python/Python.gdb/Counties", "LINE_ID = 'LID'")
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.getValue(rows)
theMessage = "State: {0}, Name: {1} , Population: {2}".format(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.getValue("STATE_NAME"),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.getValue("NAME"),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.getValue("POP2000"))
arcpy.AddMessage(theMessage)
del rows, LID&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;I needed to define "theMessage" without indentation and add row.getValue(rows) instead under "for row in rows".&lt;BR /&gt;&lt;BR /&gt;THANK YOU!!!!!!!!!!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OK this worked while I was in my other MXD but now since I have opened a new mxd it is telling me the same error that the row.getvalue(State_Name) "row" is not defined. arrrrggggg!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It wont work again in any mxd.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT: I think the reason it was working is because to make sure the fields would print i ran the print code first (see my first post) and that is where it was getting it's "row" definition&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:01:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290707#M22519</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2021-12-11T14:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290708#M22520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Amy, that code makes no sense - should fail at:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;row.getValue(rows)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...because 'rows' is your cursor object, not a field name -- try this, your code corrected from above - you must have the correct county feature class to run this on:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
LID = arcpy.GetParameterAsText(0)
rows = arcpy.SearchCursor("C:/Python/Python.gdb/Counties", "LINE_ID = 'LID'")

for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; theMessage = "State: {0}, Name: {1} , Population: {2}".format(row.getValue("STATE_NAME"), row.getValue("NAME"), row.getValue("POP2000"))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(theMessage)

del rows, LID
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Careful with indention!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Enjoy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&amp;nbsp; Or, if this helps you, the backslash is to Python a 'line continuation' character, meaning what you see in italic text should be a single line of code, expressed below perhaps easier-to-read:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-style:italic;"&gt;theMessage = "State: {0}, Name: {1}, Population: {2}".\
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format(row.getValue("STATE_NAME"), \
&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;&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; row.getValue("NAME"), \
&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;&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; row.getValue("POP2000"))&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(theMessage)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:01:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290708#M22520</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2021-12-11T14:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290709#M22521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Whenever I use arcpy.AddMessage indented under "for row in rows" it just gets ignored and no message appears even though the code runs without error&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
LID = arcpy.GetParameterAsText(0)
rows = arcpy.SearchCursor("C:/Python/Python.gdb/Counties", "LINE_ID = 'LID'")
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; theMessage = "State: {0}, Name: {1} , Population: {2}".format(row.getValue("STATE_NAME"),
row.getValue("NAME"),row.getValue("POP2000"))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(theMessage)
del rows, LID&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit: my code looks different when posted. might be having formatting issues &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The "print" version works fine in the python window so I am assuming my feature class is ok.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:01:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290709#M22521</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2021-12-11T14:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290710#M22522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I edited my response above because I was having trouble formatting my message...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have a script tool?&amp;nbsp; Are you running the code from the toolbox?&amp;nbsp; Try editing the script tool py you are using, pasting in the portion from above...again, if there's a problem, I need to know what the error messages are.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course if not running from ArcToolbox, then of course you won't see the messages.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 17:46:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290710#M22522</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-05-28T17:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290711#M22523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I edited my response above because I was having trouble formatting my message...&lt;BR /&gt;&lt;BR /&gt;Do you have a script tool?&amp;nbsp; Are you running the code from the toolbox?&amp;nbsp; Try editing the script tool py you are using, pasting in the portion from above...again, if there's a problem, I need to know what the error messages are.&lt;BR /&gt;&lt;BR /&gt;Of course if not running from ArcToolbox, then of course you won't see the messages.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope that helps.&lt;BR /&gt;Wayne&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried that and same thing and pasted that code in (yes, running and editing from toolbox with a script tool). No error or message &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 17:57:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290711#M22523</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2013-05-28T17:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290712#M22524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you showing the dialog box window messages?&amp;nbsp; There's a checkbox you can check on or off to show the messages...that's where they print to so I suspect you're simply not displaying it.&amp;nbsp; ...also do you know where to look at the Results panel?&amp;nbsp; You may optionally look at messages for each run and see any you have printed (along with error messages, if any, etc).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 18:00:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290712#M22524</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-05-28T18:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290713#M22525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've been viewing message in the results window..................when the message shows up. When I indent arcpy.AddMessage under "for row in rows" it just lets me know that the tool completed. No message&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 18:08:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290713#M22525</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2013-05-28T18:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290714#M22526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do you know you just said 'arcpy.GetMessage'... that is totally different!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 18:16:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290714#M22526</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-05-28T18:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290715#M22527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry...type o. fixed&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 18:17:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290715#M22527</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2013-05-28T18:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290716#M22528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Have you set up the tool to accept your input parameter for the query you are trying to apply?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...ahh, I see a problem with your query:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"LINE_ID = 'LID'"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LID is supposed to be a variable, not the text 'LID', understand?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 18:22:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290716#M22528</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-05-28T18:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290717#M22529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is kind of an important detail, easy to overlook, so I'm posting once more to clarify (hopefully).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since this was a file gdb (as hard-coded in the script) and using GetParameterAsText for the var LID to 'filter' the search cursor, this query should work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;rows = arcpy.SearchCursor("C:/Python/Python.gdb/Counties", "LINE_ID = '" + LID + "'")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There's more than 1 way to enter a query, but basically from the webhelp topic, Specifying a Query in Python (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/index.html#//002z0000001r000000" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//002z0000001r000000&lt;/A&gt;&lt;SPAN&gt;), a better recommended approach is something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;qry = """%s = '%s'""" % (arcpy.AddFieldDelimiters(fc, "LINE_ID"), LID)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rows = arcpy.SearchCursor("C:/Python/Python.gdb/Counties", qry)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that at least sums up better this rather lengthy thread --- for those still unsure what was happening, the incorrect query ("LINE_ID = 'LID'") was returning an empty set hence no messages...nothing to print.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Enjoy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 19:15:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290717#M22529</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-05-28T19:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: AddMessage question</title>
      <link>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290718#M22530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Worked like a charm. Muchas Gracias. Looks like I need to learn more about queries!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 20:00:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addmessage-question/m-p/290718#M22530</guid>
      <dc:creator>AmyKlug</dc:creator>
      <dc:date>2013-05-28T20:00:02Z</dc:date>
    </item>
  </channel>
</rss>

