2.2.4.32.14 OriginObject::GetConnectedObjects

Description

Retrieve the UIDs of all the objects that are connected to this object

Syntax

int GetConnectedObjects( vector<uint> & vUIDs )

Parameters

vUIDs
[output]vector to receive object UIDs

Return

the size of the vector, or -1 if error.

Examples

EX1

void OriginObject_GetConnectedObjects_Ex1()
{
    GraphPage gp;
    gp.Create();
    GraphLayer gl = gp.Layers();
    
    GraphObject goLine = gl.CreateGraphObject(GROT_LINE);
    GraphObject goText = gl.CreateGraphObject(GROT_TEXT);
    GraphObject goRect = gl.CreateGraphObject(GROT_RECT);
    goText.ConnectTo(goLine);
    goRect.ConnectTo(goLine);
    
    vector<uint> vUIDs;
    if( goLine.GetConnectedObjects(vUIDs) > 0)
    {
        for(int ii=0; ii<vUIDs.GetSize(); ii++)
        {
            GraphObject go;
            go = Project.GetObject(vUIDs[ii]);
            out_str(go.GetName());
        }
    }
}

Remark

See Also

OriginObject::ConnectTo Layer::CreateGraphObject Project::GetObject

Header to Include

origin.h