pythonaddins
is limited in reporting and displaying attributes to users. pythonaddins
is mainly a way to offer python developers a way to interact with user events. That being said the main mechanism for a developer to display messages to the user is through pythonaddins.MessageBox
.
This function takes in a message formatted as a string as the first argument, a title, and a mb_type code which refers to the type of message box, i.e. OK only, Yes/No, Retry/Cancel, etc. You could feed in the attributes you would like to report in a formatted string as the first argument to pythonaddins.MessageBox()
to report back to the user.
Here is a real quick (and sort of sloppy string formatting) example of feeding in an extent object and reporting this info back to the user, if you would like more code please let me know:
rasterObject = arcpy.Raster(inRaster)
rasterSpatialRef = rasterObject.spatialReference
rasterExtent = arcpy.Describe(rasterObject).extent
hillShadeBoolean = pythonaddins.MessageBox('\t\t' + 'Top: ' + str(rasterExtent.YMax) + '\n\n' +
'Left: ' + str(rasterExtent.XMin) + '\t\t\t' +
'Right: ' + str(rasterExtent.XMax) + '\n\n' +
'\t\t' + 'Bottom: ' + str(rasterExtent.YMin) + '\n\n' +
'Spatial Reference: ' + rasterSpatialRef.name + '\n' +
'Units: ' + rasterSpatialRef.linearUnitName + '\n\n' +
'Would you like to create a hillshade for this raster?\n',
'Raster Extent',
4)
pythonaddins
is really a python module of only five functions although you are limited in what you can do it can still be quite powerful. Click here for more info from ESRI's documentation on the pythonaddins module.