Home arrow GIS Data & Resources arrow Scripts and Code arrow ArcMap Label & .CAL arrow VB Script Label Expression for 1:24K Quads
VB Script Label Expression for 1:24K Quads PDF Print E-mail

Written by AGRC Administrator,

This script will label the SGID.U024.USGS24KQuads feature class with the SGID quad number, US quad name, and quad's Ohio code.

For use in the ArcMap Label Expression at scales around 1:400000 or so.

Function FindLabel ( [NAME], [OHIO_CODE], [LOCATION])

  tempName = [NAME]
 
  'replace up to two spaces with line breaks where needed
  If (Len(tempName) > 6 And InStr(3, tempName, " ") > 0) Then
    tempName = Replace(tempName, Left(tempName, InStr(3, tempName, " ")), _
         Left(tempName, InStr(3, tempName, " ") - 1) & vbNewLine)
    If (Len(tempName) > 15 And InStrRev(tempName, " ", Len(tempName) - 3) > 0) Then
      tempName = Replace(tempName, Mid(tempName, InStrRev(tempName, " ", _
         Len(tempName) - 3)), vbNewLine & Mid(tempName, InStrRev(tempName, " ", Len(tempName) - 3) + 1))
    End If
  End If

  'form label string with formatting tags
  locstr = "<clr red='153' green='0' blue='0'>" & [LOCATION] & "</clr>"
  tempLabel =  locstr & vbnewline & "<clr red='0' green='0' blue='0'>" & tempName & "</clr>"
  tempLabel =  tempLabel & vbnewline & "<clr red='0' green='153' blue='0'>" & [OHIO_CODE] & "</clr>"

  FindLabel = tempLabel
End Function


Users' Comments  
 

No comment posted

Add your comment

12, Mar. 2007
Last Updated ( 28, Sep. 2007 )
 
< Prev   Next >

AGRC Contacts | UGIC Contacts

feed image feed image

Utah GIS Portal © 2009 AGRC

Optimized for