I have 1 folder with shapefiles and a geodatebase. I'm trying to export the shapefiles and geodatebase feature datasets but I need to reference 2 Workspace Environments in order for the script to read both destinations.
Error Message: Runtime error Traceback (most recent call last): File "", line 68, in File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\conversion.py", line 1811, in FeatureClassToGeodatabase raise e ExecuteError: ERROR 000732: Input Features: Dataset 'ODORANT TEST POINTS.shp';COMPONENTS.shp;FARM_TAPS.shp;LINE_MARKERS.shp;MAIN_LINES.shp;METERS.shp;SERVICE_LINES.shp;STATIONS.shp does not exist or is not supported
# Read (2) Workspace environments
67. for ws in workspaces:
68. arcpy.env.workspace = ws
Code:
# Import modules
import arcpy
arcpy.env.overwriteOutput = True
# Set environment settings
workspaces = [
'M:/EIS_DRAFTS/EIS/Company SHP Files'
'M:/EIS_DRAFTS/EIS/Company SHP Files/Company UPDM.gdb'
]
# Set local variables
in_dataset_P_Integrity = ['P_Anomaly', 'P_AnomalyGroup',
'P_ConsequenceSegment',
'P_ControlPoint',
'P_CouldAffectSegment',
'P_DASurveyReadings',
'P_DocumentPoint',
'P_DOTClass',
'P_Elevation',
'P_GasOdorReport',
'P_HighConsequenceArea',
'P_ILIGroundRefMarkers',
'P_ILIInspectionRange',
'P_ILISurveyGroup',
'P_ILISurveyReadings',
'P_InlineInspection',
'P_InspectionNote',
'P_InspectionRange',
'P_LeakSurvey_AreaSurvey',
'P_LeakSurvey_Atmosphere',
'P_LeakSurvey_BareSteel',
'P_LeakSurvey_Business',
'P_LeakSurvey_CastIron',
'P_MAOPCalcRange',
'P_OperatingPressureRange',
'P_PipeCrossing',
'P_PipeExposure',
'P_ServiceInterruptionEvent',
'P_StationSeries',
'P_TestPressureRange']
in_dataset_P_PipeSystem = ['P_CompressorStation', 'P_ControllableFitting',
'P_CPAnode',
'P_CPBondJunction',
'P_CPBondWire',
'P_CPRectifier',
'P_CPRectifierCable',
'P_CPTestPoint',
'P_DehydrationEquip',
'P_Drip',
'P_ExcessFlowValve',
'P_GasLamp',
'P_GatheringFieldPipe',
'P_LineHeater',
'P_MeterSetting',
'P_NonControllableFitting',
'P_Odorizer',
'P_PigStructure',
'P_Pipes',
'P_PipeSystem_Net_Junctions',
'P_PressureMonitoringDevice',
'P_PumpStation',
'P_RegulatorStation',
'P_ReliefValve',
'P_RiverCrossing',
'P_RuralTap',
'P_Scrubber',
'P_Service',
'P_Strainer',
'P_Tank',
'P_TownBorderStation',
'P_Valve',
'P_Well']
in_dataset_P_EverythingElse = ['ODORANT TEST POINTS.shp',
'COMPONENTS.shp',
'FARM_TAPS.shp',
'LINE_MARKERS.shp',
'MAIN_LINES.shp',
'METERS.shp',
'SERVICE_LINES.shp',
'STATIONS.shp']
out_dataset_P_Integrity = 'C:/EnterpriseFolder/Company.gdb/P_Integrity'
out_dataset_P_PipeSystem = 'C:/EnterpriseFolder/Company.gdb/P_PipeSystem'
out_dataset_P_EverythingElse = 'C:/EnterpriseFolder/Company.gdb'
try:
for ws in workspaces:
arcpy.env.workspace = ws
# Use ListFeatureClasses to generate a list of inputs
for infc in arcpy.ListFeatureClasses():
arcpy.env.outputMFlag = "Disabled"
arcpy.env.outputZFlag = "Disabled"
#Execute FeatureClassToGeodatabase
arcpy.FeatureClassToGeodatabase_conversion(in_dataset_P_Integrity,out_dataset_P_Integrity)