|
POST
|
You should do your debugging outside of ArcMap. Alternatively, you can put in some error checking (such as checking if an export file exists) on frequent errors so you don't run into the problem at all. Also if you are using a script tool and you have the script embedded in the tool and you click edit, you are not editing the script that is being executed. You are editing the reference script which then needs to be reimported to be executed. This is also accomplished by restarting ArcMap which sounds like the error you are having specifically.
... View more
03-20-2012
07:34 AM
|
0
|
0
|
697
|
|
POST
|
Are you having a problem with the PDF not exporting at the correct extent, or in your mxd the layer not going to the correct extent? These flow layers are in a group layer, that's why I assume you are testing for the long name? You can restrict the layer list by just doing something like this. lyrlist = arcpy.mapping.ListLayers(mxd, "*flow*")
... View more
03-20-2012
07:22 AM
|
0
|
0
|
2821
|
|
POST
|
You might not be reading your dir properly. Try this on some directory. Replace "C:\\test" with yours. import os testdir = "C:\\test" for dir in os.listdir(testdir): dir = os.path.join(testdir,dir) if os.path.isdir(dir): print dir + " is a directory" elif os.path.isfile(dir): print dir + " is a file" else: print dir + " is not a directory"
... View more
03-20-2012
06:51 AM
|
0
|
0
|
3157
|
|
POST
|
This should be all you need unless you have some other things going on not in the code you posted. lyr = arcpy.mapping.ListLayers(mxd, "Flow", df)[0]
df.extent = lyr.getExtent()
arcpy.RefreshActiveView() Edit: You are just missing the arcpy.RefreshActiveView() I am thinking.
... View more
03-20-2012
06:35 AM
|
0
|
0
|
2821
|
|
POST
|
You can take a look at the Metadata Toolset to get some ideas.
... View more
03-19-2012
05:29 AM
|
1
|
0
|
1501
|
|
POST
|
Does this work? arcpy.mapping.ExportToPDF(mxd,r"S:\GIS Data\Scripts\Temp PDF\\"+dateTimeStamp+"sewerlines.pdf")
... View more
03-15-2012
10:57 AM
|
1
|
0
|
1615
|
|
POST
|
Oh, my mistake http://forums.arcgis.com/threads/23230-quot-ImportError-No-module-named-arcpy-quot-PYTHON
... View more
03-15-2012
09:40 AM
|
0
|
0
|
2179
|
|
POST
|
In the PythonWin interactive window[...] Well there's your problem right there. Try it in IDLE. If that doesn't work I would recommend reinstalling Python. Here's a thread with some good tips on repairing broken Python installations.
... View more
03-15-2012
09:15 AM
|
0
|
0
|
2179
|
|
POST
|
Yup, definitely some system or environment setting throwing a wrench in things. What does this return? import os
os.getenv("PYTHON")
... View more
03-15-2012
07:02 AM
|
0
|
0
|
2179
|
|
POST
|
If you post some of the code you are having issues with that may assist in debugging. A manual python install shouldn't really be an issue as long as it is referenced in your environment variables properly. IIRC, you can even have a newer version of python (2.6.5-2.6.x) installed instead of the 2.6.5 that comes with ArcGIS, and that should be fine too.
... View more
03-15-2012
05:52 AM
|
0
|
0
|
2179
|
|
POST
|
This is what you are looking for. http://code.google.com/p/pyscripter/ Ten thumbs down for PythonWin. At least in relation to arcpy.
... View more
03-14-2012
02:55 PM
|
0
|
0
|
3445
|
|
POST
|
It may have difficulty reading your path formats for some tools. Valid Python paths should be r"C:\GISpath\somefile.ext" "C:/GISpath/somefile.ext" "C:\\GISpath\\somefile.ext" Also I would suggest printing the values of your variables just before the tool to make sure there isn't something going wrong there.
... View more
03-13-2012
05:47 AM
|
0
|
0
|
1861
|
|
POST
|
Try making your XY event in a blank mxd then export it as a shapefile with WGS coordinate system and add that to your map to see if it lines up. Make sure you are using the correct geographic transformation if your map layer uses a different coordinate system.
... View more
03-13-2012
05:40 AM
|
0
|
0
|
2767
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-17-2011 10:36 AM | |
| 1 | 08-16-2012 10:48 AM | |
| 1 | 10-31-2012 08:39 AM | |
| 1 | 07-16-2012 01:52 PM | |
| 1 | 03-15-2012 10:57 AM |
| Online Status |
Offline
|
| Date Last Visited |
08-22-2024
11:12 PM
|