Rotation Renderer using Expression

Discussion created by jeremyfon001 on Jun 22, 2012
Latest reply on Aug 8, 2013 by driessenr
I am trying to symbolize some points based on a field using an expression.  I am using the IRotationRenderer2 interface to do this as it has the capability to use an expression.  I have successfully symbolized these points without the expression just using a field value, using IRotationRenderer.  But I just can't get the expression to work.  Any suggestions?

Here's the code I'm using:

IRotationRenderer2 rotationRenderer = (IRotationRenderer2)pRender;
rotationRenderer.SetSymbolRotation3DExpressions("", "", "Direction + 180");
rotationRenderer.SymbolRotation3DRotationTypeZ = esriSymbolRotationType.esriRotateSymbolGeographic;

The data source is a File Geodatabase feature class, that has a "Direction" field of type double.

When I run the code, the layer does not rotate at all.  When I open the rotation settings in ArcMap the expression is loaded correctly, and if I just close the dialog again from there (without changing a thing) it works fine.

I read in the help that I should use the Z rotation since this is a 2D feature class.

Any help would be appreciated.