-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrunCreateSubs1File.py
32 lines (28 loc) · 1.52 KB
/
runCreateSubs1File.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import arcpy
arcpy.env.overwriteOutput = True
out_dir = arcpy.GetParameterAsText(0)
out_name = arcpy.GetParameterAsText(1)
geom_type = arcpy.GetParameterAsText(2)
with arcpy.EnvManager(workspace=out_dir):
arcpy.management.CreateFeatureclass(out_dir, out_name, geom_type)
fields = [['Subbasin', 'LONG', None, None, None, None],
['Area', 'DOUBLE', None, None, None, None],
['Slo1', 'DOUBLE', None, None, None, None],
['Len1', 'DOUBLE', None, None, None, None],
['Sll', 'DOUBLE', None, None, None, None],
['Csl', 'DOUBLE', None, None, None, None],
['Wid1', 'DOUBLE', None, None, None, None],
['Dep1', 'DOUBLE', None, None, None, None],
['Lat', 'DOUBLE', None, None, None, None],
['Long_', 'DOUBLE', None, None, None, None],
['Elev', 'DOUBLE', None, None, None, None],
['ElevMin', 'DOUBLE', None, None, None, None],
['ElevMax', 'DOUBLE', None, None, None, None],
['Bname', 'TEXT', None, None, None, None],
['Shape_Len', 'DOUBLE', None, None, None, None],
['Shape_Area', 'DOUBLE', None, None, None, None],
['HydroID', 'LONG', None, None, None, None],
['OutletID', 'LONG', None, None, None, None]]
arcpy.management.AddFields(out_name, fields)
# The following message will be included in the message box from the calling button's OnClick routine
print("Creation of {0}/{1} complete.".format(out_dir, out_name))