-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChart_Index_Map.py
More file actions
39 lines (30 loc) · 1.63 KB
/
Copy pathChart_Index_Map.py
File metadata and controls
39 lines (30 loc) · 1.63 KB
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
def ChartIndex(id):
"""
to populate chart index from objectid
"""
if id % 5 == 0:
return "Sheet 005 of 005"
else:
return "Sheet 00" + str(id % 5) + " of 005"
# DRAWING NUMBER
# Select all the features of the same area and input their common names e.g., "GOSL-ZETR-KON-DWG-CL5"
# Then we'll use it to recreate the full number by adding and the sheet number.
# For example if we have already inputted DRAWING_NO = "GOSL-ZETR-KON-DWG-CL5" and for "Sheet 002 of 005":
!DRAWING_NO! = !DRAWING_NO! + "/" + !CHART_INDEX![-10:-7]
#This should give you "GOSL-ZETR-KON-DWG-CL5/002"
# SYMBOLOGY CODE
# Here I'm using the !DRAWING_NO! field as a control.
def Symb(ref,*outputs):
"""
list all your symbology codes in the order of their drawing numbers in *outputs
E.g., "IOGP3803", "IOGP3806","IOGP3814", "IOGP3805", "IOGP3804" for singlebeam, seabed features, ... because their drawing numbers end in 001,002,003... in that order
"""
return outputs[int(ref[-1:])-1]
#This picks the last digit of the number subtracts 1 (for python positioning) and returns the value at that position in the *args
Symb(!DRAWING_NO!, "IOGP3803", "IOGP3806","IOGP3814", "IOGP3805", "IOGP3804")
# For !DRAWING_NO! = "GOSL-ZETR-KON-DWG-CL5/002", this picks 2 subtracts 1 => 1, and returns the value at 1 in the *args => "IOGP3806"
# DRAWING URL
# First input your common hyperlink path to the folder in the Drawing URL field
# e.g., "..\..\Document_Reports\Charts\CLUSTER 5\"
# Then we'll use it to recreate the full URL by ading
!DRAWING_URL! = !DRAWING_URL! + "\\" + !DRAWING_NO!.replace("/", "-") + " - " + !DRAWING_NAME! + ".pdf"