-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathreset_AOI.py
61 lines (50 loc) · 2.64 KB
/
reset_AOI.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#-------------------------------------------------------------------------------
# Name: Reset UT Lands Arcgis Pro Map
# Purpose: Reset the ArcGIS Pro map to default
#
# Author: bkennady
#
# Created: 05/04/2016
# Copyright: (c) bkennady 2016
# Licence: <your licence>
#-------------------------------------------------------------------------------
import arcpy
arcpy.env.overwriteOutput
aprx = arcpy.mp.ArcGISProject("CURRENT")
ThreeDMap = aprx.listMaps("3D Map")[0]
UTLMap = aprx.listMaps("UT Lands Map")[0]
# Get layers
LateralLyr = ThreeDMap.listLayers("Oil & Gas Lateral (3D)")[0]
WellPerfsLyr = ThreeDMap.listLayers("Well Perfs (3D)")[0]
LeaseAllDepLyr = ThreeDMap.listLayers("Oil & Gas Lease (All Depths)")[0]
LeaseShallowLyr = ThreeDMap.listLayers("Oil & Gas Lease (Shallow)")[0]
LeaseIntLyr = ThreeDMap.listLayers("Oil & Gas Lease (Intermediate)")[0]
LeaseDeepLyr = ThreeDMap.listLayers("Oil & Gas Lease (Deep)")[0]
WellLyr = ThreeDMap.listLayers("Oil & Gas Well")[0]
LateralTwoDLyr = ThreeDMap.listLayers("Oil & Gas Lateral")[0]
BHLLyr = ThreeDMap.listLayers("Bottom Hole Location")[0]
# Set Query Strings (QS) back to default values
LatQueryString = ""
LeaseAllQS = "ULDB.GIS.ActiveOGLeaseParcel_View.TopDepth = 0 And ULDB.GIS.ActiveOGLeaseParcel_View.BottomDepth = 99999"
LeaseShallowQS = "ULDB.GIS.ActiveOGLeaseParcel_View.TopDepth = 0 And ULDB.GIS.ActiveOGLeaseParcel_View.BottomDepth <> 99999"
LeaseIntQS = "ULDB.GIS.ActiveOGLeaseParcel_View.TopDepth <> 0 And ULDB.GIS.ActiveOGLeaseParcel_View.BottomDepth <> 99999"
LeaseDeepQS = "ULDB.GIS.ActiveOGLeaseParcel_View.TopDepth <> 0 And ULDB.GIS.ActiveOGLeaseParcel_View.BottomDepth = 99999"
TwoDQueryString = "ULDB.GIS.Wellbore_View.WellboreStatusCode IN ('BSW', 'DR', 'GAS', 'GASIW', 'GO', 'LOC', 'NA', 'OIL', 'SI', 'SIG', 'SIGO', 'SIO', 'SIOI', 'SWC', 'SWD', 'SWDG', 'SWDO', 'TA', 'WIW', 'WIWG', 'WIWO', 'WOG', 'WSW') And ULDB.GIS.Wellbore_View.ZoneStatus <> 'NL'"
# Apply query strings to definition query
LateralLyr.definitionQuery = LatQueryString
WellPerfsLyr.definitionQuery = LatQueryString
LeaseAllDepLyr.definitionQuery = LeaseAllQS
LeaseShallowLyr.definitionQuery = LeaseShallowQS
LeaseIntLyr.definitionQuery = LeaseIntQS
LeaseDeepLyr.definitionQuery = LeaseDeepQS
WellLyr.definitionQuery = TwoDQueryString
LateralTwoDLyr.definitionQuery = TwoDQueryString
BHLLyr.definitionQuery = TwoDQueryString
# Turn layers on (Dim the lights, que bad 80s music)
LeaseAllDepLyr.visible = True
LeaseShallowLyr.visible = True
LeaseIntLyr.visible = True
LeaseDeepLyr.visible = True
# Clear Selections
ThreeDMap.clearSelection()
UTLMap.clearSelection()