Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Arcpy.mapping question

$
0
0
Hi all,

I'm having a bit of trouble with this. I'm trying to run a Python code in Pyscripter which at the end select a number of featureclasses in a gdb and adds them to a mxd that I select. The code runs without bringing up any errors but when I open the mxd it hasn't added any layers. The code I'm running is as follows:

Code:

mxd = arcpy.mapping.MapDocument("C:/Ireland/Mountains.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "*")[0]

I then add layers in the middle section of the code.

At the end of the code I then add:

Code:

arcpy.RefreshActiveView()
arcpy.RefreshTOC()

But to no avail. Without it bringing up an error message would anybody have any idea what's going wrong?

Thank you,

Dónal

Viewing all articles
Browse latest Browse all 2485