I have updated the script from my previous question;
I can't get the
if fcspatialRef != spatialRef: to work. The script won't filter the shapefiles in ArcGIS, any advice/suggestions?
import arcpy # Set Workspace arcpy.env.workspace = arcpy.GetParameterAsText(0) #Access shapefiles fcList = arcpy.ListFeatureClasses() try: # Projection template template = arcpy.GetParameterAsText(1) # Output folder outFolder = arcpy.GetParameterAsText(2) # Get the spatial reference spatialRef = arcpy.Describe(template).SpatialReference #Loop through shapfiles in folder and reproject for fc in fcList: fcspatialRef = arcpy.Describe(fc).SpatialReference if fcspatialRef != spatialRef: arcpy.Project_management(fc, outFolder + "\\" + fc, spatialRef) # Return any errors except: arcpy.AddMessage(arcpy.GetMessages ()) # Print shapefile list for fc in fcList: print fc