I wrote some ArcObjects code (ArcGIS 9.2, VB.NET) which creates some graphic elements programmatically and then exports the map. some labels that overlap with the graphic features are not displayed. the "manual" solution is to open the Labeling toolbar, click on "Label Weight Ranking" and set the feature weight of the standard layer to "none". I would like to change the feature weights programmatically. Does anybody know which interfaces I can use in order to access the feature weights of the standard layer??
Thanks a lot for your help! It worked. I created a new graphics layer for which I set the weight to zero using IBarrierProperties. I cast the IGraphicsContainer object to the graphicsLayer and add the graphic element to the container.
Since the feature weight is 0, labels that are within the graphic element bounding box are displayed now!
Here comes the code:
Dim pMap As IMap = pMxDoc.FocusMap Dim graphicsLayer As IGraphicsLayer = New CompositeGraphicsLayerClass() CType(graphicsLayer, ILayer).Name = "TESTLAYER" pMap.ActiveGraphicsLayer = CType(graphicsLayer, ILayer) pMap.AddLayer(CType(graphicsLayer, ILayer))
Dim pBarrierProperties As IBarrierProperties pBarrierProperties = graphicsLayer pBarrierProperties.Weight = 0
Dim pGContainer As IGraphicsContainer pGContainer = pMxDoc.FocusMap