AnsweredAssumed Answered

Creating Point at end of line

Question asked by bulla_b on Sep 11, 2020
Latest reply on Sep 23, 2020 by bulla_b



I've created a MapTool that creates a line and places point features at the to/from point of the line.  I use code like this to accomplish this....


I use this to get the sketch geometry to create the from point (connectionPoint) and to point (plugPoint):

var pointCollection = ((Multipart)geometry).Points;
MapPoint connectionPoint = pointCollection[0];
MapPoint plugPoint = pointCollection[pointCollection.Count - 1];


I then create the plugPoint like this:

var plugAttributes = new Dictionary<string, object>
{"SUBTYPECD", 4 },
{"DIAMETER1", 200 },
{"Shape", plugPoint.Clone() }

editOp.Create(waterFittingsLayer, plugAttributes);



Does using plugPoint.Clone create an EXACT clone??  Is there a more preferred way of doing this??


I'm finding that most of the time it does create the point correctly, but then other times the point created is not exactly the same.  I cannot figure out why this is happening.  Here are some screenshots of the values I am seeing.  The first value is the TO point of the line and the second value is the 'cloned' point.