Set extent to "Same as Display"

11-24-2011 06:17 AM
Occasional Contributor

I made a model with 'extent' as modelparameter.
When a user runs this model he has to choose "Same as Display" most of the time.

Is there a way to invoke this choice by code so user just has to push the OK-button?

Greeting, Henk
0 Kudos
1 Reply
Occasional Contributor
I thought it would be possible by code in Tool Validation:
class ToolValidator:
  """Class for validating a tool's parameter values and controlling
  the behavior of the tool's dialog."""

  def __init__(self):
    """Setup arcpy and the list of tool parameters."""
    import arcpy
    self.params = arcpy.GetParameterInfo()
  def initializeParameters(self):
    """Refine the properties of a tool's parameters.  This method is
    called when the tool is opened."""
    for param in self.params:
        if == 'Extent':
           param.ExtentRule = "Same as Display"

But that doesn't seem to work.
Anyone an idea?

Greeting, Henk
0 Kudos