Hi,
I'm trying to add a table to the table of contents from a arcpy script.
It works fine through the command dialog but when using the commands within a script nothing seems to happen.
The command "arcpy.MakeTableView_management(...)" works fine in the command line.
I can add a layer through the script using lines, but there's no option to add a table the same way.
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
theShape = r"C:\Test.gdb\Test_FC"
newlayer = arcpy.mapping.Layer(theShape)
arcpy.mapping.AddLayer(df, newlayer, "BOTTOM")
del mxd, df, newlayer
Any ideas or adive would be greatly appreciated.
Regards,
Elliott
I'm trying to add a table to the table of contents from a arcpy script.
It works fine through the command dialog but when using the commands within a script nothing seems to happen.
The command "arcpy.MakeTableView_management(...)" works fine in the command line.
I can add a layer through the script using lines, but there's no option to add a table the same way.
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
theShape = r"C:\Test.gdb\Test_FC"
newlayer = arcpy.mapping.Layer(theShape)
arcpy.mapping.AddLayer(df, newlayer, "BOTTOM")
del mxd, df, newlayer
Any ideas or adive would be greatly appreciated.
Regards,
Elliott