Modify polyline

How can I modify a line within a polyline? I tried it this way:

var op = new RModifyObjectsOperation(false);

var itm = doc.queryEntity(12),
    sh = itm.castToShape();

if (isPolylineShape(sh)
    && !sh.isGeometricallyClosed()) {

    var _sh = sh.getFirstSegment();

    if (isLineShape(_sh)) {
        _sh.setStartPoint(new RVector(1, 2));
        op.addObject(itm, false);
    }
}

di.applyOperation(op);

There is no change. Any ideas?

Hi,

Really, you know its entity 12? :wink:

What I see you do, is picking the first polyline segment and alter its startpoint.

Then you have a separated clone of the segment of the RLine type or RArc type.
Where you altered the startpoint from.

IMHO this is no ModifyObjectsOperation. :blush:

For that you have to alter the vertex of the poly and trow that as an Operation.

In my own words…
Edit: I am still a Novice… :neutral_face:

Cheers,
CVH

I’m not a novice!!!
The 12 was just for the snippet.

Oh it’s a clone. Makes sense. :smiley:

sorry, I meant: I am still…

CVH