Method AddVertex
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
AddVertex(CadDocument, string, int, GeoPoint2)
Adds a vertex to a polyline at a point, as the Add Vertex item of a polyline's grip menu does, one undo step: the new vertex goes after the vertex of the grip, or after the vertex the segment of a segment middle grip leaves from, so that it lies between that vertex and the next (after the last vertex of an open polyline it extends the end). The new segment is straight; the segment split keeps its widths, the width at the point being the one where the point falls along it. A straight segment splits in two straight ones; an arc segment in two arcs of the one arc through its start, the point and its end: a half circle from (0, 0) to (20, 0) given the point (10, -10) is two quarter circles, a bulge of 0.4142 each. A spline's point (Vertex) gets a fit point after it where the spline has fit data, else a control point, with the knot at the point of the curve nearest the point given.
public static CadEditResult AddVertex(CadDocument document, string handle, int gripIndex, GeoPoint2 point)
Parameters
documentCadDocumentThe document.
handlestringThe handle of the polyline or spline.
gripIndexintThe index of a vertex grip or a segment middle grip, as Of(DxfEntity) gives it.
pointGeoPoint2Where the vertex goes, in drawing units.
Returns
- CadEditResult
What came of it: refused for an object on a locked layer, no polyline or no such grip.
Exceptions
- ArgumentNullException
Thrown when the document is null.