Parameters
- startPt
- The start point.
- endPt
- The end point.
Exception | Description |
---|---|
System.InvalidOperationException | Incompatible spatial references. |
ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
System.ArgumentNullException | startPt or endPt is null. |
// Builder constructors need to run on the MCT. ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { // use the builder constructor using (LineBuilder lb = new LineBuilder(lineSegment)) { // find the existing coordinates lb.QueryCoords(out startPt, out endPt); // or use //startPt = lb.StartPoint; //endPt = lb.EndPoint; // update the coordinates lb.SetCoords(GeometryEngine.Instance.Move(startPt, 10, 10) as MapPoint, GeometryEngine.Instance.Move(endPt, -10, -10) as MapPoint); // or use //lb.StartPoint = GeometryEngine.Instance.Move(startPt, 10, 10) as MapPoint; //lb.EndPoint = GeometryEngine.Instance.Move(endPt, -10, -10) as MapPoint; LineSegment anotherLineSegment = lb.ToSegment(); } }); // builderEx constructors don't need to run on the MCT LineBuilderEx lbuilderEx = new LineBuilderEx(lineSegment); // find the existing coordinates lbuilderEx.QueryCoords(out startPt, out endPt); // or use //startPt = lb.StartPoint; //endPt = lb.EndPoint; // update the coordinates lbuilderEx.SetCoords(GeometryEngine.Instance.Move(startPt, 10, 10) as MapPoint, GeometryEngine.Instance.Move(endPt, -10, -10) as MapPoint); // or use //lb.StartPoint = GeometryEngine.Instance.Move(startPt, 10, 10) as MapPoint; //lb.EndPoint = GeometryEngine.Instance.Move(endPt, -10, -10) as MapPoint; LineSegment segment2 = lbuilderEx.ToSegment() as LineSegment;
Target Platforms: Windows 10, Windows 8.1