BUG
Force Element Labels do not scale correctly when added to a map. When zooming in and out, the MOLE symbols scales correctly, but the label size may grow and shrink disproportionally to the symbol.
There is a problem with the way the fonts are built on loading the Force Element Layer. This issue is related to NIM037810 and NIM038484.
Code:
Sub TestFELayerRefresh()
' ----------------------------------------------------------------------------------
' IMPORTANT: Must add reference to ESRI.DefenseSolutions (Tools | References)
' ----------------------------------------------------------------------------------
Dim theDoc As IMxDocument
Dim theGroupLayer As IGroupLayer
Dim theLayer As ILayer
' Loop through all MOLE Force Element Group Layers
Set theDoc = ThisDocument
Dim layercount As Integer
layercount = theDoc.FocusMap.layercount - 1
Dim i As Integer
For i = 0 To layercount
Set theGroupLayer = theDoc.FocusMap.Layer(i)
' Is this a group/composite layer?
Dim cl As ICompositeLayer
If (TypeOf theGroupLayer Is ICompositeLayer) Then
Set cl = theGroupLayer
' Get MOLE Force Element Layer from the Group (2nd layer, 0-indexed)
Set theLayer = cl.Layer(1)
If (TypeOf theLayer Is IForceElementLayer) Then
Dim feLayer As IForceElementLayer
Set feLayer = theLayer
Dim fegsc As IFEGraphicStyleCollection
Set fegsc = feLayer
Dim fegs As IFEGraphicStyle
Set fegs = fegsc.FEGraphicStyle(0)
'
' WORKAROUND: Toggle Font property to get labels to rebuild
'
fegs.UseFonts = False
fegs.UseFonts = True
fegsc.Current = 0
' Refresh Layer to rebuild all
Dim cglLayer As ICachedGraphicLayer
Set cglLayer = theLayer
cglLayer.Refresh
End If
End If
Next
' redraw map
theDoc.ActiveView.PartialRefresh esriViewDrawPhase.esriViewGeography, Nothing, Nothing
End Sub
Article ID:000010596
Get help from ArcGIS experts
Download the Esri Support App