I am trying to read all the link values from the Link Table(Present in the Spatial Adjustment Toolbar) in spatial Adjustment. I tried the below snippet from ESRI Website. It goes out of the loop after the first iteration although i have many links in my map. It executes without any errors.
public void GetLink()
{
IMxDocument mxDoc = app.Document as IMxDocument;
IGraphicsContainer graphicsContainer = mxDoc.FocusMap() as IGraphicsContainer;
graphicsContainer.Reset();
IElement element = graphicsContainer.Next();
while (element != null)
{
if (element is IDisplacementLinkElement)
{
IPolyline pLine = (IPolyline)element.Geometry;
System.Windows.Forms.MessageBox.Show(pLine.FromPoint.X.ToString() + "," + pLine.FromPoint.Y.ToString());
}
element = graphicsContainer.Next();
}
}
What would be the correct way of doing this?

