I have updated my script in ArcGIS 10.3 to include the copyFeatures_management geoprocessing tool because I want to only copy the features that already have the same projection, not reproject them;
#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)
But when I do, I loss what I have been trying to achieve with the shapefile list in the dialog window;
![enter image description here][1]
The script works fine without the copyFeatures_management included;
#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)
Any ideas please?
Indentation fixed, code working for me, but still printing both the projected and copied shapefiles names in list, when I only want the projected shapefile names printed.
@fluidmotion, the;
arcpy.AddMessage('{} was projected'.format(fc)) # add if you want projected fc printed to screen
isn't working at all, and,
arcpy.AddMessage('{} was copied only'.format(fc)) #add if you want copied fc printed
is printing both the projected and copied shapefile names in the loop.