I select the two (non-parallel) lines in rhino and then in VS,
go.Object(0).Geometry() and go.Object(1).Geometry() do represent the lines in Rhino but then trying to assigns these values to crv0 and crv1 is making them null…
The lines are two simple, two points, degree 1 lines.
Looks like it depends if you draw with Curve a degree-1 2-control point curve or with the command Line.
The former will not produce a line curve, the latter will. You can inspect the object with the What command. The information should contain the word Line. If you run SimplefyCurve on your input curves first, they also turn into lines.
Alternatively, you can do this in code, which works in both cases.
I know what you mean but I actually drew the lines using the “Polyline” command, I drew one segment and then ended the command… so I expected the result to be simple lines that would work but they didn’t.
Then I drew two simple lines again using the “Line” command and it did work…
The “What” command actually said: “Valid curve. Line.” for both commands (“Line” and Polyline") but again it only worked when the lines were made by the “Line” command so I still wondered what’s going on.
Thanks for the “SimplifyCrv” tip, I know the command but I was wondering what is happening to a line of two points that was created by the “Polyline” command, Rhino says it does simplify it.
It can’t simplify a Line that was made by the Line command.
Thanks for the code example too. It’s good to know although eventually it turned out that in the project that I’m working on I already got lines that do work with the example code, The issue arose only when I tested the example code by itself and drew these lines (using the polyline command) that didn’t work…