wtgeographer

Check Spatial Reference for Params in Tool Validation

Discussion created by wtgeographer on Apr 11, 2014
Latest reply on Apr 14, 2014 by wtgeographer
I am struggling trying to check the spatial reference in tool validation.  Can anybody provide a little direction.  You should get the gist of what I am trying to do with what I have here...
  def updateParameters(self):
    """Modify the values and properties of parameters before internal
    validation is performed.  This method is called whenever a parmater
    has been changed."""
    sr = arcpy.SpatialReference(2275)
    if arcpy.Describe(self.params[0]).spatialReference != sr:
        self.params[0].setErrorMessage("Coordinate System Must be SPC 4201")

Outcomes