# Rotating point using ArcObjects?

I have a problem to rotate a point (valve symbol) on a polyline I used the code below and it works with me but when I put point on line only and did not work with polyline

`````` public double pointAngle(IPoint aPoint, IFeature LineFeature)
{
IPolyline pPolyline = LineFeature.Shape as IPolyline;
IPoint pFromPoint = pPolyline.FromPoint;
IPoint pToPoint = pPolyline.ToPoint;

ILine pLine = new Line();
pLine.PutCoords(pToPoint, pFromPoint);
ILine pLine2 = new Line();
pLine2.PutCoords(aPoint, pFromPoint);
ILine pLine3 = new Line();
pLine3.PutCoords(aPoint, pToPoint);
double dAngle;
if (pLine3.Length < pLine2.Length)
{
//  dAngle = ((pLine3.Angle* 180)/pi); //Math.PI) ;
dAngle = ((pLine3.Angle * 180) / Math.PI) ;
}
else
{
dAngle = ((pLine2.Angle* 180)/ Math.PI) ;
}
dAngle = dAngle + 90;
return dAngle;

}
``````

and when I used this code nothing happen with me because I think I use ITransform2D.rotate wrong

`````` IFeature feature = dssClass.SelectFeatureByID("Valve", 180);
IPoint ppPoint = feature.Shape as IPoint;
ITransform2D pTrans2D = ppPoint as ITransform2D;
``````

All I need like this picture

• I suspect the Transform has worked you need to write the new geometry back to your dataset. As we are not seeing the whole code I can't tell if you are actually storing the feature? Jan 3, 2017 at 16:37

``````        ITransform2D pTrans2D = ppPoint as ITransform2D;