Since ArcGIS 10.1 (maybe greater) does not apparently have an easy way to select all of the values from a column (field) in the active table, I thought I could write a short ArcPy script to at least write the values to Python window.
The following code will write the values to the Python window if I pass it an explicit tablename and fieldname:
import arcpycur = arcpy.SearchCursor("myTableName")fieldname = "myFieldName"for row in cur: print row.getValue(fieldname)del row, curHowever, in order to make this a reusable Python tool, I would like to determine a way to identify:
Any ideas?
أكثر...
The following code will write the values to the Python window if I pass it an explicit tablename and fieldname:
import arcpycur = arcpy.SearchCursor("myTableName")fieldname = "myFieldName"for row in cur: print row.getValue(fieldname)del row, curHowever, in order to make this a reusable Python tool, I would like to determine a way to identify:
- the active table (in the table window), and
- the active (highlighted) column/field in that table
Any ideas?
أكثر...