In Rhino windows, I used _Join command and it returns successful result.
In my code, I’ve tried:
doc.Objects.UnselectAll();
RhinoApp.RunScript("_Join", false);
// jCrv is my array of curves
for (int i = 0; i < jCrv.Length; ++i)
{
Guid gg = doc.Objects.AddCurve(jCrv[i]);
doc.Objects.Select(gg);
}
I also tried to change
RhinoApp.RunScript("_Join", false);
to
RhinoApp.RunScript("_Join", true);
but there is nothing changed. Curves could not be joined into one curve.
(In my previous topic, I’ve tried
double epsilon = 0.001;
Curve myRetCrvs = Curve.JoinCurves(jCrv, epsilon);
but curves could not be joined into one curve. Is my epsilon too small?)
What you can do is check if the start or end point of a curve is on the same spot with a bit of tollerance. To do this you can use RhinoMath.EpsilonEquals(). If its on the same spot you can join them. If not. You probably have to filter them on their position and move the endpoint or startpoint to another curves start or endpoint. But then you have to know which curve is which and know what start point is which one.
Probably loop through all curves and try to find the closest matches (throw all end points and startpoints in a list and check findclosestpt). If they match move 1 of them to the others point.