You are on page 1of 7

GIS Customization and Programming

)Lecture(12

Create Script Tool

Engr.Ayman M. Nassar
MSc of Engineering
.Lecturer at Engineering, Planning, and GIS Dept
),University College of Applied Sciences (UCAS
Palestine.
Email: amnassar@ucas.edu.ps
Steps to Create Script Tools
Environmental Settings

Environment settings are exposed as properties on the env


class. These properties can be used to retrieve the current
values or to set them. Each environment setting has a name
and a label. Labels are displayed on the Environment Settings
dialog box in ArcGIS. Names are used in scripts or at the
command line in ArcGIS applications.
Environmental Settings
GetParameterAsText (arcpy)
Gets the specified parameter by its index position from the list of
parameters.
EXAMPLE

# import packages
import arcpy
from arcpy import env
from arcpy.sa import *
##Variables Setting
raw_raster = Raster(arcpy.GetParameterAsText(0))
Restored_image = arcpy.GetParameterAsText(1)
#Environment Settings
arcpy.env.workspace = "c:/data"

You might also like