<?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: Replicate Model Builder XML formatted Report? - Thanks! in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/replicate-model-builder-xml-formatted-report/m-p/14382#M1128</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Stacy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I appreciate those code snippets.&amp;nbsp; I'd even forgotten I posted this - that project is long past. I've built ArcObjects and JavaScript code for years with this type of message tracking, but left Python code to the automatically generated [verbose] scripts from Model Builder. PY will probably be fun and fairly familiar to learn.&amp;nbsp; It feels almost like "Back to the [AML] Future". &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Moving to Arc10 will be my autumn project, and I've heard rumors about Python eclipsing VBA in versions to come.&amp;nbsp; Do you know if that's for ALL our custom tools (oh, no!!), or only geoprocessing tasks (YAY - Model Builder has saved my hide!) ? I saw your signature's website, so figured you're a good person to ask about this. I'm sort of a Lone Ranger here and taking code conversion into account will be necessary for scheduling my work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd appreciate any insight you might have.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lynn&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jul 2011 13:34:14 GMT</pubDate>
    <dc:creator>LynnHay</dc:creator>
    <dc:date>2011-07-29T13:34:14Z</dc:date>
    <item>
      <title>Replicate Model Builder XML formatted Report?</title>
      <link>https://community.esri.com/t5/python-questions/replicate-model-builder-xml-formatted-report/m-p/14379#M1125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After running a model, you can MANUALLY generate a nice little XML report.&amp;nbsp; Is there any way to call that function from within Python since I schedule my py scripts to run off hours?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If not, what's the quick &amp;amp; dirtiest way to capture the output for review next day?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lynn&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 18:10:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/replicate-model-builder-xml-formatted-report/m-p/14379#M1125</guid>
      <dc:creator>LynnHay</dc:creator>
      <dc:date>2010-12-06T18:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate Model Builder XML formatted Report?</title>
      <link>https://community.esri.com/t5/python-questions/replicate-model-builder-xml-formatted-report/m-p/14380#M1126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Write all output to a text file at the end...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In your Python script have every message written to a master string, like so:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
masterString = ''

# some geoprocessing on dataset
str_gp1_success = 'Completed GP1 on: %s' % dataset
arcpy.AddMessage(str_gp1_success)

masterString += '\n'+str_gp1_success # append the new string to the master, with a new line...
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do this kind of thing at every message, then at the end, save it to a plain text file (the file name and location can be an input parameter if you want):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
outputFile = 'C:\\Temp\\output.txt'
w = open(outputFile,'w') # open file buffer - the second argument, w, tells it to open for writing
w.write(masterString)
w.close()
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to get fancy you can check for and delete the output file first, if it exists:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;outputFile = 'C:\\Temp\\output.txt'
if os.path.exists(outputFile ): # write to file...
 os.remove(outputFile )
 print 'Deleted; %s' % outputFile
w = open(outputFile,'w') # open file buffer - the second argument, w, tells it to open for writing
w.write(masterString)
w.close()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:35:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/replicate-model-builder-xml-formatted-report/m-p/14380#M1126</guid>
      <dc:creator>StacyRendall1</dc:creator>
      <dc:date>2021-12-10T20:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate Model Builder XML formatted Report?</title>
      <link>https://community.esri.com/t5/python-questions/replicate-model-builder-xml-formatted-report/m-p/14381#M1127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Oh, forgot to mention, you can do heaps of other fancy stuff if you can be bothered (so output is an XML, say), but it might not be worth the time...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2011 02:29:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/replicate-model-builder-xml-formatted-report/m-p/14381#M1127</guid>
      <dc:creator>StacyRendall1</dc:creator>
      <dc:date>2011-07-29T02:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate Model Builder XML formatted Report? - Thanks!</title>
      <link>https://community.esri.com/t5/python-questions/replicate-model-builder-xml-formatted-report/m-p/14382#M1128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Stacy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I appreciate those code snippets.&amp;nbsp; I'd even forgotten I posted this - that project is long past. I've built ArcObjects and JavaScript code for years with this type of message tracking, but left Python code to the automatically generated [verbose] scripts from Model Builder. PY will probably be fun and fairly familiar to learn.&amp;nbsp; It feels almost like "Back to the [AML] Future". &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Moving to Arc10 will be my autumn project, and I've heard rumors about Python eclipsing VBA in versions to come.&amp;nbsp; Do you know if that's for ALL our custom tools (oh, no!!), or only geoprocessing tasks (YAY - Model Builder has saved my hide!) ? I saw your signature's website, so figured you're a good person to ask about this. I'm sort of a Lone Ranger here and taking code conversion into account will be necessary for scheduling my work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd appreciate any insight you might have.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lynn&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2011 13:34:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/replicate-model-builder-xml-formatted-report/m-p/14382#M1128</guid>
      <dc:creator>LynnHay</dc:creator>
      <dc:date>2011-07-29T13:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate Model Builder XML formatted Report?</title>
      <link>https://community.esri.com/t5/python-questions/replicate-model-builder-xml-formatted-report/m-p/14383#M1129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Lynn,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not sure - you might be best to ask the ESRI guys! I think with 10 you can still make your own VB tools and import them as extensions (or something like that), but I'm not really sure what will be happening in the future (fortunately for me, all of my work has been in plain Model Builder or Python)...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Stacy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jul 2011 04:14:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/replicate-model-builder-xml-formatted-report/m-p/14383#M1129</guid>
      <dc:creator>StacyRendall1</dc:creator>
      <dc:date>2011-07-30T04:14:50Z</dc:date>
    </item>
  </channel>
</rss>

