Is there a way to select surface edges using Python? I don’t see a filter for it.
import rhinoscriptsyntax as rs
objs = rs.GetObject("Select curves or edges", rs.filter.curve | rs.filter.edge)
Is there a way to select surface edges using Python? I don’t see a filter for it.
import rhinoscriptsyntax as rs
objs = rs.GetObject("Select curves or edges", rs.filter.curve | rs.filter.edge)
Yeah, I looked at that before posting, but edges is not on that list, unless I’m missing something.
Bigger-picture, I’m looking to let the user select a bunch of edges and curves, and turn those all into joined polylines. Simple task for someone who knows how to do it, I’m sure.
Tried this, but it won’t let me select subobjects, so i can’t select surface or polysurface edges:
objs = rs.GetObjects(“Select curves or edges”, rs.filter.allobjects)
Hi @phcreates, maybe like below ?
import Rhino
import scriptcontext
import rhinoscriptsyntax as rs
def GetCurvesAndEdges():
go = Rhino.Input.Custom.GetObject()
go.SetCommandPrompt("Select curves and edges")
go.GeometryFilter = Rhino.DocObjects.ObjectType.Curve
go.EnablePreSelect(False, True)
go.SubObjectSelect = True
rc = go.GetMultiple(1, 0)
if rc != Rhino.Input.GetResult.Object: return
results = [obj_ref.Curve().ToNurbsCurve() for obj_ref in go.Objects()]
for curve in results: print curve
GetCurvesAndEdges()
Note that the returned curves are virtual geometries. It’s up to you what to do with them, eg. joining, conversion to polylines, adding to the document etc.
_
c.
Thank you - I’ll try that out.
Thanks Clement - that works!