Should I use the "AddMessage" instead of GetMessage ?

3840
1
Jump to solution
02-12-2015 07:14 AM
PROBERT68
Frequent Contributor

Hi All,

I am trying to  write a script to call a variable to inform that your exported has been completed. Please take a take a look at here to see if this is correct or not .

Thanks

#-------------------------------------------------------------------------------

# Name:        Export PDF

# Purpose:     To export MapLayout to PDF

# Author:      Robert.Pollock

# Created:     10/02/2015

# Copyright:   (c) Robert.Pollock 2015

#-------------------------------------------------------------------------------

import arcpy.mapping, os

str = "Your PDF exported has been delivered to your folder, Thank you"

mxd = arcpy.mapping.MapDocument("E:\FY2015_projects\Mimbres Ranch River\Mimbres River Ranch2.mxd")

arcpy.mapping.ExportToPDF(mxd,r"E:\workspace\PDF\MimbresRiverRanch34x44")

## Print message to complete the exported processed

print arcpy.GetMessages(print str.rjust(50, '0')

Thank you for your help

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor

Hi Robert,

If you want to just add a message that the PDF has been exported, I would recommend using arcpy.AddMessage.  The GetMessage should be used when you want to return a geoprocessing tool message.

View solution in original post

1 Reply
JakeSkinner
Esri Esteemed Contributor

Hi Robert,

If you want to just add a message that the PDF has been exported, I would recommend using arcpy.AddMessage.  The GetMessage should be used when you want to return a geoprocessing tool message.