This document is archived and information here might be outdated. Recommended version. |
Provides access to members that control the displacement link element.
Use this interface to set the ID of a displacement link and its draw symbol. The defaults for both properties can be obtained from the IAdjustProperties interface.
Classes | Description |
---|---|
DisplacementLinkElement | The Graphic Element to display adjustment links. |
A displacement link is a type of graphic element that supports the IDisplacementLink interface.
You can differentiate displacement links from other graphic elements by using C#'s is keyword. The following code shows an example of this.
public void GetLink()
{
//You can get app from ICommand :: OnCreate() hook parameter
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)
{
//Do something with the link.
}
element = graphicsContainer.Next();
}
}
You can differentiate displacement links from other graphic elements by using VBNet's TypeOf keyword. The following code shows an example of this.
Public Sub GetLink()
'You can get app from ICommand :: OnCreate() hook parameter
Dim mxDoc As IMxDocument = TryCast(app.Document, IMxDocument)
Dim graphicsContainer As IGraphicsContainer = TryCast(mxDoc.FocusMap(), IGraphicsContainer)
graphicsContainer.Reset()
Dim element As IElement = graphicsContainer.Next()
While Not element Is Nothing
If TypeOf element Is IDisplacementLinkElement Then
'Do something with the link.
End If
element = graphicsContainer.Next()
End While
End Sub