Public Overridable Sub SetAnchorPoint( _ ByVal anchorPoint As Coordinate2D _ )
public virtual void SetAnchorPoint( Coordinate2D anchorPoint )
Parameters
- anchorPoint
- The new anchor point location
Public Overridable Sub SetAnchorPoint( _ ByVal anchorPoint As Coordinate2D _ )
public virtual void SetAnchorPoint( Coordinate2D anchorPoint )
| Exception | Description |
|---|---|
| ArcGIS.Core.CalledOnWrongThreadException | This method must be called within the lambda passed to QueuedTask.Run. |
| System.InvalidOperationException | This element requires its mapview to be active |
{
// Note: must be called on the QueuedTask
{
//Each selected element will move to a set distance to the upper right.
var selElements = graphicsLayer.GetSelectedElements();
if (selElements.Count == 0) return;
//Move the element up
foreach (var selElement in selElements)
{
//Get the element's bounds
var elementPoly = PolygonBuilderEx.CreatePolygon(selElement.GetBounds());
//get the coordinates of the element bounding envelope.
var pointsList = elementPoly.Copy2DCoordinatesToList();
//Move the element's Anchor point to the upper right.
selElement.SetAnchorPoint(pointsList[1]);
}
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)