1

I have an ArcMap Script Tool that calls the "extent" parameter. It contains a pulldown for how to obtain extents (Default, Union of inputs, Intersection of inputs, As specified below, and Same as display). I would like to set the default selection to "As specified below" so the user doesn't have to change the setting to enter their extent values.

I've tried adding this to the tool validation but has error when applying:

  def initializeParameters(self):
    """Refine the properties of a tool's parameters.  This method is
    called when the tool is opened."""

    self.params[3].schema.extentRule = "AsSpecified"

  return

NameError: The attribute 'schema' is not supported on this instance of Parameter.

I'm not sure if I'm going about this correctly. In the Script Tool Parameter Properties, it will let me change Default = DEFAULT to values, but not the method. Possible license limitation with Basic?

5
  • 1
    Please clarify when you say script tool do you mean a script tool (.py) or actually a python toolbox script (.pyt)?
    – Hornbydd
    May 25, 2022 at 23:27
  • 1
    In ArcMap 10.6 with basic license, I just changed Script Tool Parameter Properties default from "DEFAULT" to an actual extent value e.g "0 10 25 45"
    – user2856
    May 25, 2022 at 23:50
  • It's a script tool within an ArcMap toolset, within an ArcMap toolbox.
    – atv5150
    May 26, 2022 at 17:44
  • Yes I can change the default with values, but I would like to have the default method of obtaining values for the pulldown in the tool to be "AsSpecified" as this will be the method for our purpose every time the tool is used.
    – atv5150
    May 26, 2022 at 17:48
  • Changing the parameter properties from DEFAULT to actual extent values gives me what I'm looking for, changing the default selection to As Specified Below. Thanks user2856!!
    – atv5150
    Jun 8, 2022 at 20:38

1 Answer 1

0

In the Script Tool Parameter Properties, change Property Default = DEFAULT to a set of values:

XMin YMin XMax YMax

0 0 10 10

This will set the pulldown in the Script Tool to "As Specified Below".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.