I have a script that shows certain features that are within a user-set distance of a point. I would like, however, to have those features that are "in the buffer zone" to be listed at the end when the layer is added in the form of a table. I know MakeTableView_management, but that only adds a table to the Table of Contents and doesn't open it so that doesn't really help me. Listing out rows also doesn't help since it doesn't appear clear in the message window. Therefore, is there some way to make a Table View, and have all the rows and columns of that table be displayed as a message? Or even a way to add the table and program it to automatically open?
This is what I have tried, but all it did was list the name of my table and not show anything as a message:
SourceCount = arcpy.MakeTableView_management("Selected_Sources", "Source_Table")
if arcpy.Exists("Selected_Sources"):
arcpy.AddMessage("Creating a source layer to add to the map...")
SourceLyr = arcpy.mapping.Layer("Selected_Sources")
arcpy.mapping.AddLayer(df, SourceLyr, "TOP")
arcpy.ApplySymbologyFromLayer_management("Selected_Sources", "E:/GIS/File_Organization/Data/Sources/Source_Colors.lyr")
arcpy.AddMessage("Sources surrounding your point have been added to the map and are listed below.")
arcpy.AddMessage("{0}".format(SourceCount))
else:
pass
arcpy
. Interacting with the Application framework is something you would do with ArcObjects. – Hornbydd Dec 19 '17 at 15:27