Label Transformers with Sizes

296
1
Jump to solution
02-13-2018 06:27 AM
BrentBordelon
New Contributor

Electric Utility.

We depict transformers as a single symbol.  There could be one, two or three transformers at that location.

I would like to label all the sizes at that location along with their phase designation.

(i.e. A:25
B:25
C:25)

The phase designation is within the attribute data but the sizes are in a domain.

How would you get the domain values to appear in the label when displayed?

0 Kudos
1 Solution

Accepted Solutions
PaulSottile
New Contributor II

Here is the code I use to label transformers. If there are multiple transformers at a single location I use a semicolon to separate them in the BankKva attribute field, for example and AC phase transformer bank could be 25;0;50 and would display as A-25;C-50. 

Function FindLabel ( [PhaseCode], [BankKva] )
 dim kva
 kva = [PhaseCode]
  if kva = "AB" then
    FindLabel = "A-" & split([BankKva],";")(0)&";"& "B-" & split([BankKva],";")(1)

  elseif kva = "AC" then
    FindLabel = "A-" & split([BankKva],";")(0)&";"& "C-" & split([BankKva],";")(2)

  elseif kva = "BC" then
    FindLabel = "B-" & split([BankKva],";")(1)&";"& "C-" & split([BankKva],";")(2)

  else
    FindLabel = kva  & "-" & [BankKva]
  end if
End Function

View solution in original post

0 Kudos
1 Reply
PaulSottile
New Contributor II

Here is the code I use to label transformers. If there are multiple transformers at a single location I use a semicolon to separate them in the BankKva attribute field, for example and AC phase transformer bank could be 25;0;50 and would display as A-25;C-50. 

Function FindLabel ( [PhaseCode], [BankKva] )
 dim kva
 kva = [PhaseCode]
  if kva = "AB" then
    FindLabel = "A-" & split([BankKva],";")(0)&";"& "B-" & split([BankKva],";")(1)

  elseif kva = "AC" then
    FindLabel = "A-" & split([BankKva],";")(0)&";"& "C-" & split([BankKva],";")(2)

  elseif kva = "BC" then
    FindLabel = "B-" & split([BankKva],";")(1)&";"& "C-" & split([BankKva],";")(2)

  else
    FindLabel = kva  & "-" & [BankKva]
  end if
End Function

0 Kudos