Error 000210

4211
5
01-07-2013 07:59 AM
by Anonymous User
Not applicable
Original User: MCline19

I am writing a python program.  One of my steps is suppose to take a .sde file and convert it to a shapefile.  I have tried several different processing methods and I continually receive the same error.  I have even tried running these processes directly using the toolbox (rather than through my coding) and I still receive the same error.

Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 000210: Cannot create output G:\GISAdmin\NEW_ROADS_NOTIFICATION\Road_Exports
oads2013-01-07.shp Failed to execute (Select).

I cannot figure out how to fix this issue.  I have posted the different processes that I've tried in code form below.  Thank you for any advise.

 arcpy.FeatureClassToFeatureClass_conversion('public_works.PW.Streets','G:\GISAdmin\NEW_ROADS_NOTIFICATION\Road_Exports','roads' + todaysdate + '.shp')
 arcpy.Select_analysis('public_works.PW.Streets', 'C:\Users\mcline\Downloads\roads2.shp')
 arcpy.CopyFeatures_management("public_works.PW.Streets", 'G:\GISAdmin\NEW_ROADS_NOTIFICATION\Road_Exports\roads' + todaysdate + '.shp')
0 Kudos
5 Replies
by Anonymous User
Not applicable
Original User: mzcoyle

Post the entire code you are executing or explain your environment a little more. Also, when using back slashes in your paths you need to use the r (raw string) tag to make sure they go through properly.

eg r'C:\Users\mcline\Downloads\roads2.shp'
0 Kudos
by Anonymous User
Not applicable
Original User: MCline19

More code below.  The code I posted earlier are the other processes I have tried within the "If-Then" statement.


import arcpy
import os
import datetime
from datetime import date, timedelta
from arcpy import env
env.workspace = r'G:\GISAdmin\NEW_ROADS_NOTIFICATION\Road_Exports'
dayofweek = datetime.datetime.now().weekday()
todaysdate = str(datetime.date.today())
print todaysdate

if dayofweek == 0 or 1 or 2 or 3 or 4:
 arcpy.CopyFeatures_management("public_works.PW.Streets", r'G:\GISAdmin\NEW_ROADS_NOTIFICATION\Road_Exports\roads' + todaysdate + '.shp')
else:
 print ("End: Not programmed to run on weekends.")
0 Kudos
MathewCoyle
Frequent Contributor
You have your workspace set to your output directory. You need to fully qualify your path to your input data in the tool or change the workspace to your input directory and retain the fully qualified path to your output.

Also instead of or, or, or you can do this.
if dayofweek in [0, 1, 2, 3, 4]:

Or this
if dayofweek in range(5):
0 Kudos
by Anonymous User
Not applicable
Original User: MCline19

Excellent!  Thanks for that suggestion.  I'm new to coding and still learning how to be most efficient. 
Any ideas on what's causing the error?
0 Kudos
MathewCoyle
Frequent Contributor
You need to include the path to your sde connection file.
0 Kudos