<?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: Where has AddMsgAndPrint gone in 10.4? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/where-has-addmsgandprint-gone-in-10-4/m-p/113826#M8918</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well it looks just like that function but appeared as a function of arcpy, not a separate function. It popped up in the autocompletion so I have been using it extensively in 10.3. To my surprise it has disappeared after an update. Maybe ET Tools added it? Maybe some other tool I have installed long ago and forgotten and did not realise that it extended arcpy. Is there one? What did arcapi do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 11:20:08 GMT</pubDate>
    <dc:creator>KimOllivier</dc:creator>
    <dc:date>2016-06-15T11:20:08Z</dc:date>
    <item>
      <title>Where has AddMsgAndPrint gone in 10.4?</title>
      <link>https://community.esri.com/t5/python-questions/where-has-addmsgandprint-gone-in-10-4/m-p/113824#M8916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This convenient arcpy function that was there in 10.3 has vanished at 10.4, breaking all my python scripts that use it.&lt;/P&gt;&lt;P&gt;Thanks Esri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 03:24:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/where-has-addmsgandprint-gone-in-10-4/m-p/113824#M8916</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2016-06-15T03:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Where has AddMsgAndPrint gone in 10.4?</title>
      <link>https://community.esri.com/t5/python-questions/where-has-addmsgandprint-gone-in-10-4/m-p/113825#M8917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think &lt;SPAN style="font-family: courier new,courier;"&gt;AddMsgAndPrint&lt;/SPAN&gt; was ever an &lt;SPAN style="font-family: courier new,courier;"&gt;arcpy&lt;/SPAN&gt; function. It's definitely not listed in the 10.3 or 10.2 help pages and calling &lt;SPAN style="font-family: courier new,courier;"&gt;arcpy.AddMsgAndPrint&lt;/SPAN&gt; raises an "&lt;SPAN style="font-family: courier new,courier;"&gt;AttributeError: 'module' object has no attribute 'AddMsgAndPrint'&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you sure you didn't have a custom module that&amp;nbsp; defined &lt;SPAN style="font-family: courier new,courier;"&gt;AddMsgAndPrint&lt;/SPAN&gt;? Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From: &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/tools/analysis-toolbox/tabulate-intersection.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/tools/analysis-toolbox/tabulate-intersection.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Tabulate Intersection—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def AddMsgAndPrint(msg, severity=0):
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Adds a Message (in case this is run as a tool)
&amp;nbsp;&amp;nbsp;&amp;nbsp; # and also prints the message to the screen (standard output)
&amp;nbsp;&amp;nbsp;&amp;nbsp; # 
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(msg)

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Split the message on \n first, so that if it's multiple lines, 
&amp;nbsp;&amp;nbsp;&amp;nbsp; #&amp;nbsp; a GPMessage will be added for each line
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for string in msg.split('\n'):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Add appropriate geoprocessing message 
&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; if severity == 0:
&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; arcpy.AddMessage(string)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif severity == 1:
&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; arcpy.AddWarning(string)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif severity == 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; arcpy.AddError(string)
&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:46:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/where-has-addmsgandprint-gone-in-10-4/m-p/113825#M8917</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2021-12-11T06:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Where has AddMsgAndPrint gone in 10.4?</title>
      <link>https://community.esri.com/t5/python-questions/where-has-addmsgandprint-gone-in-10-4/m-p/113826#M8918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well it looks just like that function but appeared as a function of arcpy, not a separate function. It popped up in the autocompletion so I have been using it extensively in 10.3. To my surprise it has disappeared after an update. Maybe ET Tools added it? Maybe some other tool I have installed long ago and forgotten and did not realise that it extended arcpy. Is there one? What did arcapi do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 11:20:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/where-has-addmsgandprint-gone-in-10-4/m-p/113826#M8918</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2016-06-15T11:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Where has AddMsgAndPrint gone in 10.4?</title>
      <link>https://community.esri.com/t5/python-questions/where-has-addmsgandprint-gone-in-10-4/m-p/113827#M8919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No idea, sorry. I just know that it's not in arcpy 10.2 or 10.3 on our systems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there really a need for it (other than to stop breaking existing code)?&amp;nbsp; &lt;SPAN style="font-family: courier new,courier;"&gt;arcpy.AddMessage(msg), arcpy.AddError(msg)&lt;/SPAN&gt; &lt;EM&gt;et. al&lt;/EM&gt; all print to stdout (stderr?) anyway.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:52:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/where-has-addmsgandprint-gone-in-10-4/m-p/113827#M8919</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2016-06-15T22:52:24Z</dc:date>
    </item>
  </channel>
</rss>

