Select to view content in your preferred language

convert FeatureClasses(shape) to SDE gdb after save to.lyr in the same folder

767
0
11-24-2011 05:56 AM
fredsinti
Emerging Contributor
List FeatureClasses(shape) then covert to SDE gdb after save to.lyr

thanks jsKins, it's working this script now.
So another question, about lyr; so my question is : when i export the shapefiles of my folderX(with subfloders) to geodatabase SDE, i want to save a file .lyr in myfolderX (their sub folder source) with this code python.


try:
def fcs_in_workspace(workspace):
arcpy.env.workspace = workspace
for fc in arcpy.ListFeatureClasses():
print os.path.join(workspace, fc)
arcpy.FeatureClassToGeodatabase_conversion(fc, r"C:\\\\Documents and Settings\\xx\\Application Data\\ESRI\\Desktop10.0\\ArcCatalog\\Connection to xx.sde")
for ws in arcpy.ListWorkspaces():
fcs_in_workspace(os.path.join(workspace, ws))
except Exception as e:
print e.message
arcpy.AddError(e.message)



Thanks
Bests Regards
Tags (2)
0 Kudos
0 Replies