Select to view content in your preferred language

ArcPy GetMessages() or Print

1050
1
05-30-2016 02:28 AM
Status: Closed
Labels (1)
AnjaSeckel
Regular Contributor

In the moment we can't print the messages of the tool CalculateVisualSpecification. The command "print" doesn't work. That is not clear for us, because it is a simple standard command. With the red commands in the script, all messages will be print at the end of the tool. Is it possible to print the messages immediately, so that the user get an information about the progress of the tool?

 

# Process: Calculate Visual Specifications

arcpy.CalculateVisualSpecifications_production(fc_list, mdb, "'MGCP_50K :: MGCP TRD 4.3 Visual Specification for MGCP Topographic Map (MTM)'", "RENDER_REPRESENTATIONS", "DISPLAY_LABELS", "PRESERVE")

m = arcpy.GetMessages()

arcpy.AddMessage (m)

1 Comment
HannesZiegler
Status changed to: Closed

Thank you for your submission, and apologies for the very late response. Your post was only recently redirected to the correct ideas exchange for Python/ArcPy ideas. However, this appears to be a question rather than an idea. 

Please note that idea Exchanges are not the right place to ask questions or get technical support. However, just because your post isn’t an Idea does not mean that we aren’t here to help. The esri community forum is a great place to ask and get help with questions. See Tag: "arcpy" in "ArcGIS Pro Questions" - Esri Community for ArcPy questions and Tag: "python" in "ArcGIS Pro Questions" - Esri Community for general questions about Python in ArcGIS Pro. If you have encountered a bug, you may also reach out to Technical Support. Support will help you establish a reproducible workflow that will then help us debug and address the issue.

Note: To contact Technical Support, you need to be an authorized caller. See Why can't I submit cases? (Or, How I became an authorized caller and reported my issue) for more information.

Regarding your question, print is not expected to work with Script tools, print works with the standard (console) output. Tool messages are added with AddMessage—ArcGIS Pro | Documentation and the various message and error handling functions (see side-bar in link). You can also communicate progress script tool progress by customizing the progressor using the various progressor functions, see SetProgressor—ArcGIS Pro | Documentation