IWxView.GetShapeByPt

Syntax

GetShapeByPt(Position: IGxPointF): IWxShape;

GetShapeByPt(Position: Prognoz.Platform.Interop.Drawing.IGxPointF): Prognoz.Platform.Interop.Andy.IWxShape;

Parameters

Position. View point.

Description

The GetShapeByPt method gets an object by the defined coordinate.

Example

Executing the example requires a form with the Button1 button, the WorkspaceBox component named WorkspaceBox1 and a data source for the WorkspaceBox1.

Add links to the Andy, Drawing, Workspace system assemblies.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    ws: IWxWorkspace;
    view: IWxView;
    PointF: IGxPointF;
    arrow: IWxArrow;
    ellipse: IWxEllipse;
    Shape: IWxShape;
Begin
    // Get workspace for editing
    ws := UiWorkspace1.WxWorkspace;
    view := ws.CreateView;
    view := ws.Views.Item(0);
    ellipse := ws.CreateEllipse;
    arrow := ws.CreateArrow;
    Arrow.FirstPoint := New GxPointF.Create(1010);
    Arrow.LastPoint := New GxPointF.Create(319);
    ellipse := ws.CreateEllipse;
    PointF := New GxPointF.Create(1010);
    Shape := view.GetShapeByPt(PointF);
    view.ActiveShape := Shape;
End Sub Button1OnClick;
Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Workspace;
Imports Prognoz.Platform.Interop.Drawing;

 
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    ws: IWxWorkspace;
    view: IWxView;
    Shape: IWxShape;
    arrow: IWxArrow;
    ellipse: IWxEllipse;
    PinPoint, PointF: GxPointF = 
New GxPointFClass();
Begin
    
// Get workspace for editing
    ws := uiWorkspaceNet1.WxWorkspace;
    view := ws.CreateView();
    view := ws.Views.Item[
0];
    arrow := ws.CreateArrow();
    PinPoint.Create(
1010);
    Arrow.FirstPoint := PinPoint;
    PinPoint.Create(
319);
    Arrow.LastPoint := PinPoint;
    ellipse := ws.CreateEllipse();
    PointF.Create(-
66, -7);
    Shape := view.GetShapeByPt(PointF);
    view.ActiveShape := Shape;

End Sub;

After executing the example, the object which is in this view point is selected.

See also:

IWxView