How to make objref.Edge() return BrepEdge?

When using Rhino.Input.RhinoGet.GetMultipleObjects with Rhino.DocObjects.ObjectType.EdgeFilter

objref.Edge() would return Brep Edge Geometry.

I have a Brep and its Edge. How do I pack it into objref, so objref.Edge() would return that Edge?

Hello - if you want the curve, Edge.EdgeCurve will find that… ?

-Pascal

No, I want Rhino.Geometry.BrepEdge object

Right now, selecting brep edges with GetMultipleObjects or GetObject “packs” it into objref variable,
so objref.Brep() would spit out Rhino.Geometry.Brep object and
objref.Edge() would output Rhino.Geometry.BrepEdge object.

If I do randombrep = Rhino.DocObjects.ObjRef(randombrepGUID),
randombrep.Edge() will return None, 'cause “it doesn’t know” which edge I want it to output, 'cause I didn’t click any edges on it. How do I make it to know if I have the brep ObjRef and Edge Geometry of that brep?

Hi @Asterisk,

Why do you need to do this?

– Dale

'cause I thought maybe there’s a simple way to assign it to ObjRef. I’ve only started dabbling in rhinocommon.

It stems from this:
image

Hi @Asterisk,

An ObjRef is an object, created by GetObject, that provides the call details on what the user interactively picked.

Given this, why do you want to create an ObjRef on your own? What problem does this help you solve?

– Dale

I don’t really need to do that, but I thought I’d ask in case it’s something as simple as assigning an attribute to an object.

Hello - not quite sure I am interpreting correctly but:

    go = Rhino.Input.Custom.GetObject()
    go.GeometryFilter = Rhino.DocObjects.ObjectType.EdgeFilter
    go.SetCommandPrompt("Select an edge")

    go.Get()
    if go.CommandResult()!=Rhino.Commands.Result.Success:
        return go.CommandResult()
    brepEdge = go.Object(0).Edge()

?

-Pascal