<?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: Using the Calculate Value Tool and messaging in Model Builder in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375842#M12905</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The ability to create script tools ("embed them in a toolbox") has been around since 9.0.&amp;nbsp; If you're on 9.3, you can start with this help topic : &lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_creating_script_tools"&gt;An overview of creating script tools&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dale, thanks for the link. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;What we're talking about here is embedding a script into a toolbox so a separate .py file is not needed. This is a new (and welcome) functionality in 10.0. From the &lt;A href="&amp;lt;/span&amp;gt;&amp;lt;a" target="_blank"&gt;What's" rel="nofollow" target="_blank"&amp;gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/What_s_new_for_geoprocessing_in_ArcGIS_10/00qp0000000q000000/]What's&lt;/A&gt;&lt;SPAN&gt; New in ArcGIS 10:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;...you can import your .py file into the tool (in fact, you must do this to password protect a script tool). This means &lt;STRONG&gt;you don't have to deliver a separate .py file for your script tool to work, the .py will be saved within the toolbox.&lt;/STRONG&gt;&lt;/BLOCKQUOTE&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Jul 2011 21:03:11 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2011-07-01T21:03:11Z</dc:date>
    <item>
      <title>Using the Calculate Value Tool and messaging in Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375834#M12897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I came across this &lt;/SPAN&gt;&lt;A href="http://blogs.esri.com/Dev/blogs/geoprocessing/archive/2011/06/06/ModelBuilderIfThenElse1.aspx" rel="nofollow"&gt;blog&lt;/A&gt;&lt;SPAN&gt; about using the Calculate &lt;/SPAN&gt;&lt;STRONG style="font-style: italic;"&gt;Value&lt;/STRONG&gt;&lt;SPAN&gt; tool. The blog is for ArcGIS 10 but I was able to adapt an example to 9.3.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found this blog really useful as I never knew about this particular tool and being able to write &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;if then else&lt;/SPAN&gt;&lt;SPAN&gt; logic but still within model builder is extremely useful as it avoids the need for having to build scripts that are ultimately files that sit outside a toolbox.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I created a simple python function that tested for the existence of a field and output a boolean which is a precondition for what ever. It all worked great.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now my question is simple, how do you write a message to the output window when a model is running? If you look at the code below I've tried two methods but it nevers writes anything, is it possible?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code block contained the following code for the Calculate Value tool:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def test(f):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; import arcgisscripting&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; gp = arcgisscripting.create(9.3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; desc = gp.Describe(f)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; fi = desc.FieldInfo&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; f = fi.FindFieldByName("RIVER")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; if f == -1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; return "False"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; else:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; gp.Addmessage("Hello world")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; print "Hello Word"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; return "True"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The output in the model dialog is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;dimgray&amp;quot;;"&gt;Executing (Calculate Value): CalculateValue test("%FC%") "def test(f):\n import arcgisscripting\n gp = arcgisscripting.create(9.3)\n desc = gp.Describe(f)\n fi = desc.FieldInfo\n f = fi.FindFieldByName("RIVER")\n if f == -1:\n return "False"\n else:\n gp.Addmessage("Hello world")\n print "Hello Word"\n return "True"" Boolean true&lt;BR /&gt;Start Time: Thu Jun 30 17:06:39 2011&lt;BR /&gt;Value = True&lt;BR /&gt;Executed (Calculate Value) successfully.&lt;BR /&gt;End Time: Thu Jun 30 17:06:39 2011 (Elapsed Time: 0.00 seconds)&lt;BR /&gt;Executing (Get Count): GetCount "Base data\NRFA_Gauge_Locations" 1661&lt;BR /&gt;Start Time: Thu Jun 30 17:06:39 2011&lt;BR /&gt;Row Count = 1661&lt;BR /&gt;Executed (Get Count) successfully.&lt;BR /&gt;End Time: Thu Jun 30 17:06:39 2011 (Elapsed Time: 0.00 seconds)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see I never see &lt;/SPAN&gt;&lt;STRONG&gt;Hello World &lt;/STRONG&gt;&lt;SPAN&gt;in the output.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 15:07:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375834#M12897</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2011-06-30T15:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Calculate Value Tool and messaging in Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375835#M12898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&lt;SPAN&gt;I posted this same question &lt;A href="&amp;lt;/span&amp;gt;&amp;lt;a" target="_blank" rel="nofollow noopener noreferrer"&gt;here&lt;/A&gt; and have no response yet... I'm pretty sure it can't be done. The best I've been able to come up with -- outside of writing a script tool - is this: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Expression: &lt;/SPAN&gt;&lt;STRONG&gt;"\n\n** YOUR PARAMETER IS WEAK **\n** TRY AGAIN **\n"&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;(no code block)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This shows up in the messaging as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Executing (Message): CalculateValue "\n\n** YOUR PARAMETER IS WEAK **\n** TRY AGAIN\n" # Variant
Start Time: Thu Jun 30 10:51:10 2011
Value = 

** YOUR PARAMETER IS WEAK **
** TRY AGAIN **

Succeeded at Thu Jun 30 10:51:10 2011 (Elapsed Time: 0.00 seconds)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could set this up with a precondition to have it print the message under certain conditions (perhaps determined by another Calculate Value tool boolean result).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;All,&lt;BR /&gt;&lt;BR /&gt;I came across this &lt;A href="http://blogs.esri.com/Dev/blogs/geoprocessing/archive/2011/06/06/ModelBuilderIfThenElse1.aspx" rel="nofollow noopener noreferrer" target="_blank"&gt;blog&lt;/A&gt; about using the Calculate &lt;STRONG style="font-style: italic;"&gt;Value&lt;/STRONG&gt; tool. The blog is for ArcGIS 10 but I was able to adapt an example to 9.3.&lt;BR /&gt;&lt;BR /&gt;I found this blog really useful as I never knew about this particular tool and being able to write &lt;SPAN style="font-style:italic;"&gt;if then else&lt;/SPAN&gt; logic but still within model builder is extremely useful as it avoids the need for having to build scripts that are ultimately files that sit outside a toolbox.&lt;BR /&gt;&lt;BR /&gt;So I created a simple python function that tested for the existence of a field and output a boolean which is a precondition for what ever. It all worked great.&lt;BR /&gt;&lt;BR /&gt;Now my question is simple, how do you write a message to the output window when a model is running? If you look at the code below I've tried too methods but it nevers writes anything, is it possible?&lt;BR /&gt;&lt;BR /&gt;The code block contained the following code for the Calculate Value tool:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
def test(f):
&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcgisscripting
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp = arcgisscripting.create(9.3)
&amp;nbsp;&amp;nbsp;&amp;nbsp; desc = gp.Describe(f)
&amp;nbsp;&amp;nbsp;&amp;nbsp; fi = desc.FieldInfo
&amp;nbsp;&amp;nbsp;&amp;nbsp; f = fi.FindFieldByName("RIVER")
&amp;nbsp;&amp;nbsp;&amp;nbsp; if f == -1:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "False"
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.Addmessage("Hello world")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Hello Word"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "True"
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;The output in the model dialog is:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Executing (Calculate Value): CalculateValue test("%FC%") "def test(f):\n&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcgisscripting\n&amp;nbsp;&amp;nbsp;&amp;nbsp; gp = arcgisscripting.create(9.3)\n&amp;nbsp;&amp;nbsp;&amp;nbsp; desc = gp.Describe(f)\n&amp;nbsp;&amp;nbsp;&amp;nbsp; fi = desc.FieldInfo\n&amp;nbsp;&amp;nbsp;&amp;nbsp; f = fi.FindFieldByName("RIVER")\n&amp;nbsp;&amp;nbsp;&amp;nbsp; if f == -1:\n&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "False"\n&amp;nbsp;&amp;nbsp;&amp;nbsp; else:\n&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.Addmessage("Hello world")\n&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Hello Word"\n&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "True"" Boolean true
Start Time: Thu Jun 30 17:06:39 2011
Value = True
Executed (Calculate Value) successfully.
End Time: Thu Jun 30 17:06:39 2011 (Elapsed Time: 0.00 seconds)
Executing (Get Count): GetCount "Base data\NRFA_Gauge_Locations" 1661
Start Time: Thu Jun 30 17:06:39 2011
Row Count = 1661
Executed (Get Count) successfully.
End Time: Thu Jun 30 17:06:39 2011 (Elapsed Time: 0.00 seconds)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;As you can see I never see &lt;STRONG&gt;Hello World &lt;/STRONG&gt;in the output.&lt;BR /&gt;&lt;BR /&gt;Duncan&lt;/BLOCKQUOTE&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:22:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375835#M12898</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T17:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Calculate Value Tool and messaging in Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375836#M12899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Curtis,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh dear, thanks for your idea, a bit of a fudge but I guess a tool should really exist, &lt;/SPAN&gt;&lt;A href="http://ideas.arcgis.com/ideaView?id=08730000000bp9FAAQ"&gt;I suggested this on the ideas website&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 14:54:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375836#M12899</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2011-07-01T14:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Calculate Value Tool and messaging in Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375837#M12900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In Arc 10 you could create a python script and import it into the toolbox - this is a new functionality that will do what you want. But I do agree that there should be a standard tool for this and voted up your idea!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;Here's the &lt;A href="&amp;lt;/span&amp;gt;&amp;lt;a" target="_blank"&gt;online" rel="nofollow" target="_blank"&amp;gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//005700000017000000.htm]online&lt;/A&gt;&lt;SPAN&gt; help on embedding scripts in toolboxes.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 16:56:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375837#M12900</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2011-07-01T16:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Calculate Value Tool and messaging in Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375838#M12901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try the attached script tool to add custom message in ModelBuilder.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 17:58:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375838#M12901</guid>
      <dc:creator>ShitijMehta</dc:creator>
      <dc:date>2011-07-01T17:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Calculate Value Tool and messaging in Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375839#M12902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Curtis,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ah! This is good news about embedding scripts into the toolbox. I don't have v10 although there is a v10 machine in the office but I have yet to get up to date with whats new.&amp;nbsp; So what happens if you embed a python script then realise you've got a bug in it (highly likely as I hate using Python!), is the process of embedding a script a one way task or can you un-embed it to edit it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;In Arc 10 you could create a python script and import it into the toolbox - this is a new functionality that will do what you want. But I do agree that there should be a standard tool for this and voted up your idea!&lt;BR /&gt;&lt;BR /&gt;Here's the &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//005700000017000000.htm" target="_blank"&gt;online help on embedding scripts in toolboxes.&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 18:32:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375839#M12902</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2011-07-01T18:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Calculate Value Tool and messaging in Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375840#M12903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The ability to create script tools ("embed them in a toolbox") has been around since 9.0.&amp;nbsp; If you're on 9.3, you can start with this help topic : &lt;/SPAN&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_creating_script_tools"&gt;An overview of creating script tools&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 20:20:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375840#M12903</guid>
      <dc:creator>DaleHoneycutt</dc:creator>
      <dc:date>2011-07-01T20:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Calculate Value Tool and messaging in Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375841#M12904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's an attempt to do up a nice tool for this, with documentation. This tool works in 9.3 or 10.x, and has validation associated with it. It has an output status variable (0,1,2) you can use for a precondition or a model variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know you may hate having to code, but the Python script interface is pretty nice.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;A href="&amp;lt;/span&amp;gt;&amp;lt;a" target="_blank" rel="nofollow noopener noreferrer"&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;IMG src="http://img225.imageshack.us/img225/6106/messagetool.th.png" /&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(Thanks, shitijmehta, for the idea.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Usage: ModelMessage &amp;lt;Message_text&amp;gt; {NONE | WARNING | ERROR} {0 | 1 | 2} &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's how it looks when you run it in a model in the geoprocessing message stream:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Executing: MessageModel
Start Time: Fri Jul 01 15:41:02 2011
Executing (Message): ModelMessage "\nHello, world!\n" NONE 0 0
Start Time: Fri Jul 01 15:41:03 2011
Running script ModelMessage...

Hello, world!

Completed script ModelMessage...
Executed (Message) successfully.
End Time: Fri Jul 01 15:41:03 2011 (Elapsed Time: 0.00 seconds)
Executed (MessageModel) successfully.
End Time: Fri Jul 01 15:41:03 2011 (Elapsed Time: 1.00 seconds)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:22:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375841#M12904</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T17:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Calculate Value Tool and messaging in Model Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375842#M12905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The ability to create script tools ("embed them in a toolbox") has been around since 9.0.&amp;nbsp; If you're on 9.3, you can start with this help topic : &lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_creating_script_tools"&gt;An overview of creating script tools&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dale, thanks for the link. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;What we're talking about here is embedding a script into a toolbox so a separate .py file is not needed. This is a new (and welcome) functionality in 10.0. From the &lt;A href="&amp;lt;/span&amp;gt;&amp;lt;a" target="_blank"&gt;What's" rel="nofollow" target="_blank"&amp;gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/What_s_new_for_geoprocessing_in_ArcGIS_10/00qp0000000q000000/]What's&lt;/A&gt;&lt;SPAN&gt; New in ArcGIS 10:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;...you can import your .py file into the tool (in fact, you must do this to password protect a script tool). This means &lt;STRONG&gt;you don't have to deliver a separate .py file for your script tool to work, the .py will be saved within the toolbox.&lt;/STRONG&gt;&lt;/BLOCKQUOTE&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 21:03:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-the-calculate-value-tool-and-messaging-in/m-p/375842#M12905</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2011-07-01T21:03:11Z</dc:date>
    </item>
  </channel>
</rss>

