1

enter image description here

I have a model folder which contains several shapefile, but only one named oil.shp. Is there a way to automatically set the default value for the Add Oil Layer based on the model folder and the shapefile's name? It can be done by using os.path.join(model_folder, 'oil.shp') if I don't set Add Oil Layer as one parameter. However, I want to leave the parameter there in case someone else wants to play around with another oil.shp as needed. The Script Properties comes from the Script tool.

I am using ArcGIS Desktop 10.3.1 Advanced License.

0

1 Answer 1

1

To do this you would use tool validation. I recommend reviewing Understanding validation in script tools where the parts to pay attention to include:

Provide default values for parameters, such as cell size for rasters.

(it has a picture)

and

Internal validation doesn't do the following (but you can with your own validation code):

...

  • Calculate default values.

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.