Quantcast
Channel: Forums - ArcGIS for Desktop - General
Viewing all articles
Browse latest Browse all 2565

Question: How to add geodatabase table to arcmap 10 using python code

$
0
0
I am using ArcMap 10 with SP5. I am trying to add a file geodatabase table to my ArcMap document using Python Code. I can add layers, but cannot seem to get it to work for tables.

For layers, I am using:
mxd = arcpy.mapping.MapDocument("CURRENT")
dataframe = arcpy.mapping.ListDataFrames (mxd, "*")[0]
addLayer = arcpy.mapping.Layer(layername)
arcpy.mapping.AddLayer(dataframe, addlayer)
arcpy.RefreshActiveView()
arcpy.RefreshTOC()

I have a variable for the table: tablename = OutputDatabase + "\\geo_table_name"

Any ideas?

Brian Donaldson

Viewing all articles
Browse latest Browse all 2565

Trending Articles