private void RecreateLineGeometry(IElement elem, IAGAnimationTrack pTrack, IAGKeyframe pKeyframe, IPoint new_pos)
{
IGeometry newGeometry = new PolylineClass();
IPointCollection newPointCol = (IPointCollection)newGeometry;
IAGAnimationTrackKeyframes trackKeyframes = (IAGAnimationTrackKeyframes)pTrack;
int tCount = trackKeyframes.KeyframeCount;
object missing = Type.Missing;
for (int i = 0; i < tCount; i++)
{
IAGKeyframe tempKeyframe = trackKeyframes.get_Keyframe(i);
newPointCol.AddPoint((IPoint)tempKeyframe.get_PropertyValue(0), ref missing, ref missing);
if ((IPoint)tempKeyframe.get_PropertyValue(0) == (IPoint)pKeyframe.get_PropertyValue(0))
break;
}
if (new_pos != null)
newPointCol.AddPoint(new_pos, ref missing, ref missing);
elem.Geometry = newGeometry;
}