GraphObject::GetNode

 

Description

Get each node's coordinate by index

Syntax

BOOL GetNode( int nIndex, fpoint & ptNode )

Parameters

nIndex
the node index
ptNode
[output] return point value of the coordinate

Return

TRUE for success

Examples

EX1

// For this example to run, a graph window must exist in the project
// and have a rectangle object in it.
void Graph_GetNode_ex1()
{
    GraphLayer gl = Project.ActiveLayer();
    foreach(GraphObject gr in gl.GraphObjects)
    {
        fpoint ptNode;
        int iNodes = gr.GetNumOfNodes();
        if (iNodes > 1 )
        {
            printf("Name = %s\n", gr.GetName());
            printf("Number of nodes = %d\n", iNodes);
            for (int ii = 0; ii < iNodes; ii ++)
            {
                gr.GetNode(ii, ptNode);
                printf("Point %d: X= %f Y = %f\n", ii, ptNode.x, ptNode.y);
            }
        }
    }    
}

Remark

See Also

Header to Included

origin.h