POST
|
Yes, this is a real problem. I think it looks awful. Here is an example. [ATTACH=CONFIG]29763[/ATTACH] I am using 10.2 with Maplex engine enabled.
... View more
12-11-2013
04:26 AM
|
0
|
0
|
598
|
POST
|
Here is another example that looks even more like a table. The text in bold italics must be modified to suit your data. [ATTACH=CONFIG]29762[/ATTACH] Again, I used a .csv file as my relate table. Function FindLabel ( [RelateFieldOfLayer] )
iMaxLbl1Sz = 0
iMaxLbl2Sz = 0
iSpace = 5
Set gp = CreateObject("esriGeoprocessing.GPDispatch.1")
strWhereClause = chr(34) & "RelateFieldOfTable" & chr(34) & " = '" & [RelateFieldOfLayer] & "'"
strpTable = "PathToRelateTable"
Set prows = gp.searchcursor(strpTable,strWhereClause)
Set prow = prows.next
Do until prow is nothing
strLabel1 = prow.LabelField1
strLabel2 = prow.LabelField2
If (Len(strLabel1) > iMaxLbl1Sz) Then
iMaxLbl1Sz = Len(strLabel1)
End If
If (Len(strLabel2) > iMaxLbl2Sz) Then
iMaxLbl2Sz = Len(strLabel2)
End If
Set prow = prows.next
Loop
FindLabel = FindLabel & "<FNT name='Arial' size='6.25'>" & [RelateFieldOfLayer] & "</FNT>" & vbnewline
FindLabel = FindLabel & String(iMaxLbl1Sz + iMaxLbl2Sz + iSpace, "_") & vbnewline
Set prows = gp.searchcursor(strpTable,strWhereClause)
Set prow = prows.next
Do until prow is nothing
strLabel1 = prow.LabelField1
strLabel2 = prow.LabelField2
k1 = (iMaxLbl1Sz - Len(strLabel1)) + 2
k2 = iSpace + (iMaxLbl2Sz - Len(strLabel2)) - 3
FindLabel = FindLabel & strLabel1 & "<CLR red='255' green='255' blue='255'>" & String(k1, ".") & "</CLR>"
FindLabel = FindLabel & "|"
FindLabel = FindLabel & "<CLR red='255' green='255' blue='255'>" & String(k2, ".") & "</CLR>" & strLabel2 & vbnewline
Set prow = prows.next
Loop
End Function
... View more
12-11-2013
04:16 AM
|
2
|
0
|
1271
|
POST
|
Here is some vbscript code I created to label using related (one-to-many) tables based on tips found here: http://www.esri.com/news/arcuser/1104/files/vbscript_label.pdf and here http://gisnuts.com/terra/blog/2012/05/16/label-features-with-attributes-from-related-records. You must change the items in italics to suit your datasets. My relate table happened to be a .csv file. And I used a font (Lucida Console) in which every character is exactly the same width so that my numbers (see pic) would line up on the right. Function FindLabel ( [RelateField] )
iMaxLbl1Sz = 0
iMaxLbl2Sz = 0
iSpace = 3
Set gp = CreateObject("esriGeoprocessing.GPDispatch.1")
strWhereClause = chr(34) & "RelateFieldinTable" & chr(34) & " = '" & [RelateField] & "'"
strpTable = "path to your relate table"
Set prows = gp.searchcursor(strpTable,strWhereClause)
Set prow = prows.next
Do until prow is nothing
strLabel1 = prow.Depths
strLabel2 = prow.TotalPAHs
If (Len(strLabel1) > iMaxLbl1Sz) Then
iMaxLbl1Sz = Len(strLabel1)
End If
If (Len(strLabel2) > iMaxLbl2Sz) Then
iMaxLbl2Sz = Len(strLabel2)
End If
Set prow = prows.next
Loop FindLabel = "<UND>" & FindLabel & [RelateField] & "</UND>" & vbnewline
Set prows = gp.searchcursor(strpTable,strWhereClause)
Set prow = prows.next
Do until prow is nothing
strLabel1 = prow.Depths
strLabel2 = prow.TotalPAHs
k = (iMaxLbl1Sz - Len(strLabel1)) + iSpace + (iMaxLbl2Sz - Len(strLabel2))
FindLabel = FindLabel & strLabel1 & String(k, ".") & strLabel2 & vbnewline
Set prow = prows.next
Loop
End Function
... View more
12-10-2013
11:50 AM
|
2
|
0
|
1271
|
Title | Kudos | Posted |
---|---|---|
2 | 12-10-2013 11:50 AM | |
2 | 12-11-2013 04:16 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|