POST
|
Right I knew that I just didn't think about it iterating the actual group too. It was a silly oversight on my part:/
... View more
06-24-2015
07:12 AM
|
0
|
0
|
1241
|
POST
|
Ok i fixed that but i'm still getting the error due to the files being in groups. I like Xander Bakker pointed out.
... View more
06-24-2015
07:10 AM
|
0
|
0
|
811
|
POST
|
I do have group layers. Thats why I scripted it the way I did. Any chance you could advise me on how to successfully iterate though them? I see what you mean though... I did a "for lyr in layers: print lyr and see why it's causing the error.
... View more
06-24-2015
07:00 AM
|
0
|
3
|
1241
|
POST
|
I also just verified my file paths again. they are correct. Any other suggestions?
... View more
06-24-2015
06:58 AM
|
0
|
0
|
1241
|
POST
|
I could be mistake but the only thing I'm pulling from the Default GDB is the one shapefile that i'm using to compare files to. Correct me if i'm mistaken? And i am out putting as a test to the file that once I get this script working I'll purge the file and start using the actual MXD that I need this script to process. The current one is just a subset of the data from the original.
... View more
06-24-2015
06:56 AM
|
0
|
0
|
1241
|
POST
|
Hey all, I've got an arcpy question for you. I'm still new to python as well but I think i have a decent handle on it. But i'm not sure why this script isn't working. It's pretty basic but I keep getting an error. Can someone point out the issue for me? I'd really appreciate it. import arcpy mxd = arcpy.mapping.MapDocument(r'C:\Users\JOC-001\Documents\GIS\HSIP\Infrastructure\HSIP_Gold_2015_Infrastructure2.mxd') layers = arcpy.mapping.ListLayers(mxd) for lyr in layers: arcpy.SelectLayerByLocation_management(lyr, "WITHIN_A_DISTANCE", r"C:\Users\JOC-001\Documents\ArcGIS\Default.gdb\Illinois", "50 Miles", "NEW_SELECTION") arcpy.FeatureClassToFeatureClass_conversion(lyr, r'C:\Users\JOC-001\Documents\GIS\HSIP\IL_Infrastructure2015', lyr+'.shp') And the error i'm receiving Traceback (most recent call last): File "C:\Users\JOC-001\Desktop\ArcGIS.py", line 7, in <module> arcpy.SelectLayerByLocation_management(lyr, "WITHIN_A_DISTANCE", r"C:\Users\JOC-001\Documents\ArcGIS\Default.gdb\Illinois", "50 Miles", "NEW_SELECTION") File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 6812, in SelectLayerByLocation raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000840: The value is not a Feature Layer. ERROR 000840: The value is not a Raster Catalog Layer. ERROR 000840: The value is not a Mosaic Layer. Failed to execute (SelectLayerByLocation).
... View more
06-24-2015
06:45 AM
|
0
|
17
|
5116
|
POST
|
Mr. Craft, I apologize I forgot to mark your answer as correct:( But it looks like an admin took care of it. I just wanted to say sorry for forgetting you
... View more
02-04-2015
08:08 AM
|
0
|
0
|
394
|
POST
|
Hello All, I have written a code to download some data, run a few operations, symbolize it, and export it but I need this code to run on a timer. IE execute itself every 15 minutes. My issue is that I can not figure out how to write the script so that it will execute the file every fifteen minutes. Once it's written I plan having it run on startup so that if the computer is up it will update my files for the operations center. Any advice would be greatly appreciated!
... View more
01-05-2015
09:55 AM
|
0
|
1
|
4121
|
POST
|
You too, Mr. Patterson! You were a great help! I've also followed you after looking at your credentials! I might have to call upon your assistance again one day:P
... View more
12-23-2014
11:52 AM
|
0
|
0
|
201
|
POST
|
I was actually in the process of reinstalling everything from the start as you posted that. It fixed the issue. Thanks again for your help!
... View more
12-23-2014
10:15 AM
|
0
|
2
|
1398
|
POST
|
I know that's my issue. I had python 2.7 installed prior to installing ArcGIS, so I uninstalled python from the computer completely then used the ArcGIS 10.2 install disc to reinstall it assuming the disc would install it properly. Yet I still have the disconnect when trying to import arcpy after doing all of that and I don't understand what I'm doing wrong to fix it.
... View more
12-23-2014
08:38 AM
|
0
|
4
|
1398
|
POST
|
I can get past it if im not trying to import arcpy. I have a few other scripts that run smoothly. The issue only arises when I am trying to do anything that requires me to import arcpy.
... View more
12-23-2014
08:26 AM
|
0
|
6
|
1398
|
POST
|
This is my only directory under python 27 C:\Python27\ArcGIS10.2 which is what the ArcGIS 10.2 disc installed after I completely uninstalled python. The attachment also shows all the files located under that directory. I feel it might be useful to mention thought, that under the directory below, arcpy can be found. It just seems to me there is a connection issue between python / IDLE and my actual arcpy library. But I'm not skilled in how to fix an issue like this. C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy
... View more
12-23-2014
08:01 AM
|
0
|
8
|
1398
|
POST
|
I'm having an issue importing arcpy into my Python scripts outside of ArcGIS. I've completely uninstalled Python and deleted the directory. I then used the 10.2 install disc to repair my version of ArcGIS hoping that doing so would correct any issues created from having python 2.7 installed prior to ArcGIS 10.2 installation. Yet after the repair I tried to run my .py file and it gave me this error again. (Error attached as jpg)
... View more
12-23-2014
07:44 AM
|
0
|
10
|
4973
|
POST
|
Mr. Gerbrandt, I'm currently looking for the same type of script. I was hoping that you might have found your solution by now and could share it with me?
... View more
12-22-2014
09:34 AM
|
0
|
1
|
357
|
Title | Kudos | Posted |
---|---|---|
1 | 06-24-2015 07:52 AM | |
1 | 06-24-2015 10:02 AM | |
1 | 06-24-2015 07:53 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|