Question 1: How do I reference the user selected edge. It turns out component index does not always align with the index in Geometry.Edges. How do I use the component index from Rhino.Input.Custom to reference the selected edge within the surface / brep?
Question 2: Is there an easy way to copy the selected edge?
If you run the Python code and select the edge shown below, the code tries to copy it referencing Geometry.Edges with the Component Index and it adds a new line but it’s the wrong edge, so Component Index does not equal the index within Geometry.Edges.
edge.Duplicate works great for copying the edge, but the alternative method does not access the correct edge. Here’s the revised code that I tried. It’s still acting like what I described above where if I duplicate it by the PointAtStart and PointAtEnd points, it’s referencing the wrong edge.
Any ideas?
brep = r.Brep()
edge = brep.Edges[idx]
line = rs.AddLine(edge.PointAtStart, edge.PointAtEnd)
At this point I am trying to understand how to access the correct edge in the brep object via it’s Edges list when I have the Component Index from GetObject method.