Select to view content in your preferred language

Really basic question about Python window - layers not available

1385
5
Jump to solution
10-22-2012 07:16 PM
RosieBell
Emerging Contributor
I'm sure this is ridiculously simple, but I can't get it to work.

I'm using the arcpy.Clip_management tool. When I type the following into the window:

arcpy.Clip_management("

A drop down box appears, showing all the raster layers that exist in my mxd. I can select one and then complete the rest of the script.

However, if I've started using the python window, then add another layer to my mxd, it doesn't appear in the down down box when I reach this point in the script. It's almost like it needs a refresh to appear. At the moment the only thing I've found to work is restarting ArcGIS. The attached image shows 3 rasters in the table of contents - bunbury, cli7, and perth - but only the original two come as options in the Python window.

TIA.[ATTACH=CONFIG]18634[/ATTACH]
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
curtvprice
MVP Alum
Bumping this up as it's still an issue for me. Anyone else experience this, or find a solution?


Rosie, I can reproduce this. A fix that works for me is to reload arcpy:

>>> reload(arcpy)

View solution in original post

0 Kudos
5 Replies
MathewCoyle
Honored Contributor
What version/SP of ArcGIS are you running? Do you start a new line in your python window after you've added the new raster?
0 Kudos
RosieBell
Emerging Contributor
Hi Mathew,

I'm running ArcGIS Desktop 10 SP3. I do start a new line after adding. I've also tried clearing all my python, closing and reopening the window - no luck though.
0 Kudos
RosieBell
Emerging Contributor
Bumping this up as it's still an issue for me. Anyone else experience this, or find a solution?


I'm sure this is ridiculously simple, but I can't get it to work.

I'm using the arcpy.Clip_management tool. When I type the following into the window:

arcpy.Clip_management("

A drop down box appears, showing all the raster layers that exist in my mxd. I can select one and then complete the rest of the script.

However, if I've started using the python window, then add another layer to my mxd, it doesn't appear in the down down box when I reach this point in the script. It's almost like it needs a refresh to appear. At the moment the only thing I've found to work is restarting ArcGIS. The attached image shows 3 rasters in the table of contents - bunbury, cli7, and perth - but only the original two come as options in the Python window.

TIA.[ATTACH=CONFIG]18634[/ATTACH]
0 Kudos
curtvprice
MVP Alum
Bumping this up as it's still an issue for me. Anyone else experience this, or find a solution?


Rosie, I can reproduce this. A fix that works for me is to reload arcpy:

>>> reload(arcpy)
0 Kudos
RosieBell
Emerging Contributor
Rosie, I can reproduce this. A fix that works for me is to reload arcpy:

>>> reload(arcpy)



Thanks Curtis! I tried this, and it works perfectly.
0 Kudos