I just could not make this attribute driven symbology feature to work using ArcGIS Pro SDK. The following is a snippet of my code:
var render = lyr.CreateRenderer(simpleRender) as CIMSimpleRenderer;
var cimExpressionInfoZ = new CIMExpressionInfo { ReturnType=ExpressionReturnType.Numeric, Expression = "$feature.Direction" };
var cimVisualVariableInfoZ = new CIMVisualVariableInfo { VisualVariableInfoType = VisualVariableInfoType.Expression, ValueExpressionInfo = cimExpressionInfoZ};
var listCIMVisualVariables = new List<CIMVisualVariable>
{
new CIMRotationVisualVariable {
VisualVariableInfoZ = cimVisualVariableInfoZ,
RotationTypeZ=SymbolRotationType.Arithmetic
}
};
render.VisualVariables = listCIMVisualVariables.ToArray();
lyr.SetRenderer(render);
I would like to rotate the symbol based on a field called "Direction" with angles range 0 - 360. The symbols have been rotated but not according to the values in "Direction" fields. Any help will be great appreciated.