Hi all,
I need to select a set of edges of a brep in order to run a fillet by a Python script.
I wrote the following in order to select the edges, but nothing is selected:
import Rhino
import scriptcontext
def edgeB():
filter = Rhino.DocObjects.ObjectType.PolysrfFilter
rc, objref = Rhino.Input.RhinoGet.GetOneObject("Select first set of polysurfaces", False, filter)
if rc != Rhino.Commands.Result.Success: return rc
if not objref: return Rhino.Commands.Result.Failure
brep = objref.Brep()
bre = objref.Object()
edgelist=brep.Edges
for i in edgelist:
if i.Degree>1:
print bre.SelectSubObject(i.ComponentIndex(),True,True)
scriptcontext.doc.Views.Redraw()
edgeB()
i`m not shure but i think you cannot select or highlight edges this way and then start the regular fillet command. You also have a print statement before your selection in the above example.
In order to fillet brep edges, the only way i know is to use a rolling ball fillet with (extracted) surfaces and pass pick-points as uv parameters.
gianpaolo, i forgot to attach the modified example:
import Rhino
import scriptcontext
import rhinoscriptsyntax as rs
def edgeB():
filter = Rhino.DocObjects.ObjectType.PolysrfFilter
rc, objref = Rhino.Input.RhinoGet.GetOneObject("Select first set of polysurfaces", False, filter)
if rc != Rhino.Commands.Result.Success: return rc
if not objref: return Rhino.Commands.Result.Failure
brep = objref.Brep()
bre = objref.Object()
bre.Select(False)
edgelist=brep.Edges
for i in edgelist:
if i.Degree>1:
print(i)
bre.SelectSubObject(i.ComponentIndex(),True, True)
scriptcontext.doc.Views.Redraw()
rs.Sleep(500)
edgeB()
Grazie mille!!!
Thanks Clement,
it seems that it not possible select persistently a brepedge as in the case of mesh edge.
Thanks for the suggestion about fillet, best wishes,
g
Thanks Dale,
I have try in Rhino 6, but the selection is not yet persistent (or I must change anything in the script).
I know the Surface.CreateRollingBallFillet, but my model is a complex closed polysurface. I need to fillet a set of edge with a specific lenght and a specific degree. More over I need to change the radius of the filllet.
I’d like to persistently select this edges and then apply rs.command("_FilletEdge…
Thanks again,
g
The SelectSubObject function in RhinoCommon V6 will eventually have a new, additional bPersistentSelect flag that you will need to specify. Implement it is on the V6 to-do list.
Also, the FilletEdge command does not recognize pre-selected edges. This is also on the V6 list.