Edge Or Curve Input for a component

Hi guys,

I want to have a input in my component. This input can link to a edge on a brep or any curve like spline, line, arc, etc.
Could anyone please tell me how to do it? I have ask chatgpt, it has many suggestions, but none of them works.
Regards
Eric

Hi Eric,

We need more context here. Is this a cluster? Scripting Component? Can you share a GH file?

This isn’t really enough to go on. Are you trying to have curves influence your component of have the component extract curves from another type of geometry like a surface or brep?

Please provide more info,

Thanks

Hi Michael,

Here are codes snippet:

    protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager)
    {
        // Use the pManager object to register your input parameters.
        pManager.AddGenericParameter("Unfold Vec Dir", "CD", "The Curve/Edge should be along the roughly rectangular shape of the surfaces.", GH_ParamAccess.item);

;;;
}

        IGH_GeometricGoo curve = null;
        iDA.GetData(0, ref curve);

        if (curve is GH_BrepEdge edgeWrapper) // here we can't compile. 
        {
                    ;;;;
        }
        else if (curve is GH_Curve curveWrapper)
        {
                   '''''
        }

Here is the basic structure suggested from chatgpt.

What I want is a vector. I use the end points of the curve to calculate the vector. Most of the time, I need a vector calculated based on the brep edge. I want to user to select one edge on a brep. If there is no suitable edge to select, user can create a line which can be used as an input as well.

Hope I have made my problem clear.
Thank you.
Regards
Eric