Graphic layer: How to rotate a graphic Element

487
2
03-11-2022 01:12 AM
KarthikAditya
New Contributor III

I would like to rotate/ flip a graphic element using the Pro SDK but could not find any references for doing this.

See below images for reference.

Line element with marker arrow symbol

KarthikAditya_0-1646988557816.png

Marker arrow symbol after vertical flip

KarthikAditya_1-1646988693930.png

Below is the code snippet of how I'm creating an element. How can I rotate or flip it while creating it?

CIMSymbolReference symbolReference = SymbologyHelper.GetLineSymbolReference("Marker Arrow 1");

CIMLineGraphic cimGraphicElement = new CIMLineGraphic
{
Line = geometry as Polyline,
Symbol = symbolReference
};
graphicsLayer.AddElement(cimGraphicElement);

0 Kudos
2 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

I think you need to rotate geometry first (before creating cimGraphicElement). It could be done by using GeometryEngine Rotate method. More info here:

https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/#topic8281.html 

KarthikAditya
New Contributor III

Thank you. will try this out

0 Kudos