AnsweredAssumed Answered

Script geoprocessing dialog window help

Question asked by ccnrm on Apr 14, 2015
Latest reply on Apr 16, 2015 by ccnrm

In ArcGIS 10.3, I had my shapefile list working in the script geoprocessing dialog window for the projection tool;

 

# Get the spatial reference

spatialRef = arcpy.Describe(template).spatialReference.name

 

# Loop through shapfiles in folder and reproject

for fc in fcList:

  fcspatialRef = arcpy.Describe(fc).spatialReference.name

  if fcspatialRef != spatialRef:

   arcpy.Project_management(fc, outFolder + "\\" + fc, template)

 

# Print shapefile Project results

  arcpy.AddMessage(fc)

 

# Return any errors  

except:

arcpy.AddMessage(arcpy.GetMessages())

 

 

But when I add in copyFeatures_management because I want to copy the files which are already in the same projection and not reproject them, the dialog window changes and I lose my shapefile list in the geoprocessing dialog window;

 

# Get the spatial reference

spatialRef = arcpy.Describe(template).spatialReference.name

 

# Loop through shapfiles in folder and reproject

for fc in fcList:

  fcspatialRef = arcpy.Describe(fc).spatialReference.name

  if fcspatialRef != spatialRef:

   arcpy.Project_management(fc, outFolder + "\\" + fc, template)

  else:

   arcpy.CopyFeatures_management(fc, outFolder + "\\" + fc)

 

# Print shapefile Project results

arcpy.AddMessage(fc)

 

# Return any errors  

except:

arcpy.AddMessage(arcpy.GetMessages())

 

 

Can anyone please assist?

Outcomes