Hi,
We just try to make a custom C# sweep1 component which wont work. The
problem we tracked down lies somewhere in the MRhinoObjRef so the
rail_curve stays invalid. If anyone has an idea it would be helpful.
The .net example on the Rhinowebsite deals with selected objects,
where the ObjectId is passed to MRhinoObjRef, so I just tried that too
in GH: MRhinoObjRef rail_ref = new MRhinoObjRef(rail.ModelObjectId());
but something doesnt work:

   // generate needed Objects
    MRhinoPolyEdge edge = new MRhinoPolyEdge();
    OnBrep[] srf = new OnBrep[1];
    MArgsRhinoSweep1 args = new MArgsRhinoSweep1();

    // convert the shapecurve into an Array (as there is only one
here)
    OnCurve[] shapes = new OnCurve[1];
    shapes[0] = shape;

    // converting the rail curve
    MRhinoObjRef rail_ref = new MRhinoObjRef(rail.ModelObjectId());
    IRhinoObject rail_obj = rail_ref.Object();
    IOnCurve rail_crv = rail_ref.Curve();

    // filling the edge with input
    edge.Create(rail_crv, rail_obj);

    // filling the args with input
    args.m_shape_curves = shapes;
    args.m_rail_curve = edge;

    // do the sweep
    RhUtil.RhinoSweep1(ref args, out srf);

    // output the resulting surface
    A = srf;

Reply via email to