Table of Contents

Method JoinEntity

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

JoinEntity(DxfEntity)

Joins another curve into the entity, as AutoCAD's JoinEntity does by the rules of its JOIN: the entity's record is written anew to run over both, its look and every group the joining is not about kept, and the other is left as it is, for the caller to erase. Ends meet within the point tolerance of Default, 0.001, measured in space.

public void JoinEntity(DxfEntity secondaryEntity)

Parameters

secondaryEntity DxfEntity

The curve to join, in this entity's drawing, another or none.

Remarks

What joins into what, as AutoCAD's JOIN says. A DxfLine takes lines along its line, overlapping or with gaps between them, and runs from the lowest of all their ends to the highest in its own direction: the line from (0, 0, 0) to (10, 0, 0) joined to the one from (25, 0, 0) to (15, 0, 0) runs to (25, 0, 0). A DxfArc takes arcs of its circle, gaps and all, counter-clockwise from its start: the quarter from 0 to pi / 2 joined to the arc from pi to 3 pi / 2 runs from 0 to 3 pi / 2, and to one that reaches back over its start, from that one's start; a DxfEllipse takes elliptical arcs of its ellipse alike, by its parameter. An arc whose normal is the other way is the same arc run the other way. One that would make the whole circle or ellipse is refused, as AutoCAD's JOIN makes a CIRCLE of it, which an ARC is not. Where either end moves both are written, the start within a turn: an ellipse whose file gives the parameters -3 and -2 joined to its arc from 2 pi - 2 to 2 pi - 1.5 runs from 2 pi - 3 to 2 pi - 1.5. The gaps follow the JOIN command; that AutoCAD's JoinEntity fills them too is not confirmed.

A DxfPolyline or a DxfPolyline2d takes lines, arcs and polylines of the plane of its normal at its elevation, the whole of each arc within the tolerance of that plane, end to end at either of its ends, each turned to run on along it: an arc as a segment of its bulge, turned over where its normal is the other way, a polyline with its bulges and widths, a line or an arc of no width; the polyline (0, 0), (10, 0) joined to the arc of radius 5 about (10, 5) from -pi / 2 to pi / 2 is (0, 0), (10, 0), (10, 10) with a bulge of 1 on its second vertex. A DxfPolyline3d takes lines, 3D polylines and polylines of the plane with no arc, in any plane; a curved one is refused, as AutoCAD's JOIN makes a spline of a 3D polyline joined to a curve, which a POLYLINE does not become in place. A DxfSpline takes lines, arcs, elliptical arcs, polylines and splines, each as the spline that is exactly it (Spline, a polyline fitted with a spline as the one of the vertices it is drawn through), all raised to the highest degree among them and joined with their knots run on one from the other, the spline's own kept (an arc run on by its angle, a polyline by 1 a segment and a line by 1, as AutoCAD 2021 ran them on a spline of knots 0 to 56.57); it is given by its control points from then on. Where the joined ends come back together the polyline or spline is closed, its last vertex the first: the polyline of one side of a square 10 by 10 joined to lines of the other three is closed, of area 100.

A closed curve is not joined, nor is a fitted polyline or a polyline of no vertices, and a piece of no length at an end is joined and adds nothing. A piece that would run back over the one at the end it meets, to that one's far end through its middle, is not joined, as a line drawn twice is not: the line from (10, 0) back to (0, 0) is not joined to the polyline (0, 0), (10, 0), which it would close into a loop of no area. A spline's flags that it is planar and linear (8 and 16 of group 70) are taken off where it no longer is. The vertices of a POLYLINE are written anew, each with a handle of its own, the POLYLINE and its SEQEND keeping theirs; a LWPOLYLINE keeps the groups of its own vertices.

Exceptions

ArgumentNullException

Thrown when the curve is null.

ArgumentException

Thrown when the curve is this entity or erased, or is not joined: of a kind this one does not take, closed, out of its plane, not along its line or of its circle, meeting neither end within the tolerance, running back over the piece at that end, having no vertices, or making an arc whole. Nothing is written then.

InvalidOperationException

Thrown when the entity is erased, or has no ends to join at: a closed polyline or spline, a whole ellipse, a fitted polyline, a line of no length, a polyline of no vertices.

NotSupportedException

Thrown for a class AutoCAD's JOIN joins nothing into, as a CIRCLE or a TEXT.