1

I'm looking to add a line break in the ArcGIS Pro geoprocessing window for a custom .pyt tool. In Arcmap, putting "\n" into an arcpy.AddMessage() statement works fine, but this does not work in ArcGIS Pro - the messages are reported in the geoprocessing window, but there is no line break. Any idea how this can be done in ArcGIS Pro?

This doesn't work:

    arcpy.AddMessage(observers)
    arcpy.AddMessage("\n")
    arcpy.AddMessage("\n")
    arcpy.AddMessage(targets)

And neither does this:

    arcpy.AddMessage(observers)
    arcpy.AddMessage("\r\n")
    arcpy.AddMessage("\r\n")
    arcpy.AddMessage(targets)
1

If you want to add a message in the Python window, you need to use the Python print statement:

print("some text")

If you want to see your message in the Geoprocessing pane, your code should work. To see tool messages, hover over the progress bar, or click the pop-out button, as explained in the Help:

When a tool is running, a progress bar is displayed to show completion percentage, and a cancel button is available to stop processing. You can hover on the progress bar to display a popup window containing comprehensive information about the tool that is running, such as messages, execution time, and all tool settings. You can also click the pop-out button Tool progress to see the same information in a detached window, or expand the messages section to view any geoprocessing messages.

  • That doesn't seem to work on the ArcGIS Pro Geoprocessing window. arcpy.AddMessage does work, but not with '/n' – Pitrako Junior Nov 10 '17 at 11:51
  • @Pitrako Jr So does it work? – GISGe Nov 10 '17 at 13:14
  • No, it doesn't work – Pitrako Junior Nov 10 '17 at 13:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.