How do I combine all three workspaces?
Only 1 workspace is being read while exporting data.
import os
import arcpy
# Set environment settings
arcpy.env.workspace = "C:/eis/eis shape/UPDM.gdb/P_PipeSystem"
arcpy.env.workspace = "C:/eis/eis shape/UPDM.gdb/OtherCompanies"
arcpy.env.workspace = "C:/eis/eis shape/UPDM.gdb/NEO"
arcpy.env.overwriteOutput = True
# Set local variables
outWorkspace = "C:/data"
try:
# Use ListFeatureClasses to generate a list of inputs
for infc in arcpy.ListFeatureClasses():
# Determine if the input has a defined coordinate system, can't project it if it does not
dsc = arcpy.Describe(infc)
if dsc.spatialReference.Name == "Unknown":
print ('skipped this fc due to undefined coordinate system: ' + infc)
else:
# Determine the new output feature class path and name
outfc = os.path.join(outWorkspace, infc)
# Set output coordinate system
outCS = arcpy.SpatialReference('WGS 1984')
# run project tool
arcpy.Project_management(infc, outfc, outCS)
# check messages
print(arcpy.GetMessages())
except arcpy.ExecuteError:
print(arcpy.GetMessages(2))
except Exception as ex:
print(ex.args[0])
arcpy
can only have one current workspace, turn your code into function that takes a workspace then call it three times, one for each input workspace. – Hornbydd 2 days ago