Select to view content in your preferred language

How to display the calculated value of a tool in ArcMap

986
3
04-18-2011 06:46 PM
abubadruddin
Deactivated User
Hi:
I have a script that calculates the total and average population using the attribute layer of the county and returns the output on the interactive window in PythonWin.
I made a tool from the script and it runs fine in ArcGIS. But don't know how to display the calculated result in some from of text message within ArcGIS interface.
Please Help!!

Abu Badruddin
Tags (2)
0 Kudos
3 Replies
NiklasNorrthon
Frequent Contributor
arcpy.AddMessage('The value is...: %.2f' % value)
0 Kudos
abubadruddin
Deactivated User
Thanks a lot. It works, but how do you display only the result.
Example: Arcpy.AddMessage('The value is...: %.2f' % value) display the result along with other messages (start time, elapsed time, etc). Can you just display the result?
0 Kudos
DarrenWiens2
MVP Alum
Arcpy.AddMessage() just prints the string between the (). The given example uses formatted text to make it pretty. If you only want the string in a variable called value, it would be Arcpy.AddMessage(value).
0 Kudos