OC: CreateGraphObject() provides an option to replace existing


Version: 2018

Type: Features

Category: Programming

Subcategory: Origin C

Jira: ORG-17138


Add a bit, GROBJ_REPLACE_EXISTING,for  CreateGraphObject() to replace existing

void aa(double xx, int nColor, string strName = "line")
{
    GraphLayer gly = Project.ActiveLayer();
    GraphObject goLine = gly.CreateGraphObject(GROT_LINE, strName, GROBJ_REPLACE_EXISTING);
    goLine.SetProp("attach", 2);
    goLine.SetProp("direction", 2);//vertical
    goLine.SetProp("x1", xx);
    goLine.SetProp("y1", 2);
    goLine.SetProp("y2", 8);
    goLine.SetProp("color", nColor);
    goLine.SetProp("arrowEndShape",1);
}