STK X Send comments on this topic.
Add Method (AgDrawElemCollection)
See Also  Example
ElemType
Type of element to create. Currently only "Rect" is supported.





Description

Factory to create and add a new element to the end of the sequence.

Syntax

[Visual Basic .NET]
Public Function Add( _
   ByVal ElemType As String _
) As IAgDrawElem

[C#]
public IAgDrawElem Add(
string ElemType
);

[Managed C++]
public: IAgDrawElem^ Add(
String __gc ^ ElemType
);

[Java]
public IAgDrawElem add(
String ElemType
);

[Unmanaged C++]
public: HRESULT Add(
BSTR ElemType,
IAgDrawElem ** ReturnValue
);

Parameters

ElemType
Type of element to create. Currently only "Rect" is supported.

Return Type

Returns a new drawing element (interface IAgDrawElem).

When the input parameter Type is "Rect", the return data is of type AgDrawElemRect.

If the input parameter Type is incorrect, an automation exception is raised.

Example

[Visual Basic .NET] Copy Code
Private Sub AxAgUiAxVOCntrl1_MouseMoveEvent( _
                ByVal sender As Object, _
                ByVal e As AxAGI.STKX.IAgUiAxVOCntrlEvents_MouseMoveEvent) _
        Handles AxAgUiAxVOCntrl1.MouseMoveEvent

    If pickMode = 2 Then

        If curRect Is Nothing Then

            Dim r As AgDrawElemRect
            r = Me.AxAgUiAxVOCntrl1.DrawElements.Add("Rect")

            ...

            curRect = r

        End If

        curRect.Set(x0, y0, e.x, e.y)
    End If

End Sub

See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1