2.2.4.37.6 PolyPolylineGraphObject::RemovePolyline


Description

Remove one polyline object by index.

Syntax

int RemovePolyline( int nIndex )

Parameters

nIndex
[input] index of the polyline

Return

Number of points of the polyliine or -1 for error

Examples

EX1

void RemovePolyline_ex1()
{    
//Assumes current project has some polylines in PolyPolylineGraphObject selected(you can select multiple polylines by shift key) 
    foreach(OriginObject obj in Selection.Objects)
    {
        PolyPolylineGraphObject plobj;
        plobj = obj;
        if( !plobj )
            continue;
        
        vector<int> vSelection;
        int    nCount = plobj.GetInternalSelection(vSelection);
        vSelection.Sort(SORT_DESCENDING);
        for(int ii = 0; ii < nCount; ii++)
            plobj.RemovePolyline( vSelection[ii] );
        
        GraphLayer gl;
        plobj.GetParent(gl);
        if(gl)
            gl.GetPage().Refresh(true);
    }
}

Remark

See Also

PolyPolylineGraphObject::AddPolyline

Header to Included

origin.h