AnsweredAssumed Answered

Symbology is copied successfully but symbology rotation is not

Question asked by mzdijjw2 on Sep 6, 2013
Latest reply on Sep 7, 2013 by mzdijjw2
Hi all,

I tried to copy symbologies from a layer to another layer. And this is my code:

Dim symbolFLayer As IFeatureLayer symbolFLayer = pMxDoc.FocusMap.Layer(indexSourceLayer) Dim pGeoFLayer As IGeoFeatureLayer pGeoFLayer = symbolFLayer  Dim targetGeoFLayer As IGeoFeatureLayer targetGeoFLayer = outputFeatLayer targetGeoFLayer.Renderer = pGeoFLayer.Renderer


The source layer and the target layers are point layers and they have exactly the same attributes. The source layer has a catogorised symbology with unique values. And the code above copied all the Unique value symbologies to the target layer successfully.

Now the problem comes when I need to copy the rotated symbologies. Both the source and the target layers have a field with a double data type called "Heading" that store the various angle values of the rotation. The source layer has a symbology that is rotated according to the value of the field "Heading". And I still cannot copy the rotated symbology. This is my trial code (continuation from above code):

Dim pRotationRenderer As IRotationRenderer pRotationRenderer = targetGeoFLayer.Renderer pRotationRenderer.RotationField = "Heading" pRotationRenderer.RotationType = esriSymbolRotationType.esriRotateSymbolGeographic pMxDoc.ActiveView.Refresh()


The result of the code above is only showing normal unique symbologies with normal angle (on the target layer). All symbologies
have the same angle (on the target layer). There is no error, but why it does not work?

I hope someone has a solution for this. Thank you.

Outcomes