There are surfaces or polysurfaces that I want to duplicate one or more of the edges of. I’d like to click on the edge and have a curve or curves created that duplicate the selected edge. The code should emulate the Rhino dupEdge command.
Once selected, I want to apply a name to that curve and then move on to another edge or to an edge of another surface.
So far, I haven’t been able to find how to do the selection. Once I have that, I already have the ability to add a name to it, but I’m missing some piece of the process for selecting the edge.
In normal Rhino modeling, the user issues the dupEdge command and selects the desired edge. Without further ado, the edge is duplicated and the resulting curve is left selected.
What I need to do is have the user click on the desired edge and have the plugin determine which edge was selected. In the current (and typical) case, there are eight edges.
I have the code to handle the selection, duplication and naming, but I need to know which Brep edge was clicked on.
var curve = brep.Edges[i].DuplicateCurve();
depends on knowing the value of i, which is where I’m stumped.
The variable, i, has a value between zero and the number of edges minus 1. I’ve selected only one of those multiple edges. I want the plugin to determine which of those edges I selected. I only want one edge, not all of them.
Accordingly, as i traverse the following array of edges:
for (int i = 0; i < go.ObjectCount; i++)
I want to know what the index (i) of that one edge is, so I can cause a curve to be created on that edge and not on any of the rest of the edges.