Someone help~


#1

this is mycode

    private void ColumnLine_Click(object sender, EventArgs e)
    {
        m_ColumnCurveList.Clear();
        m_CurveList.Clear();

        Rhino.Input.Custom.GetObject go = new Rhino.Input.Custom.GetObject();
        go.SetCommandPrompt("Select objects");
        go.SubObjectSelect = false;
        go.GroupSelect = true;
        go.GetMultiple(1, 0);
        go.GeometryFilter = Rhino.DocObjects.ObjectType.Curve;

        int count = go.ObjectCount;

        for (int i = 0; i < count; i++)
        {
            Rhino.DocObjects.ObjRef objref = go.Object(i);
            Rhino.DocObjects.RhinoObject obj = objref.Object();
            if (obj == null)
                return;
            Rhino.Geometry.Curve curve = objref.Curve();
            m_CurveList.Add(curve);
        }

        try
        {
            foreach (Curve c in m_CurveList)
            {
                Point3d p1 = AreaMassProperties.Compute(c).Centroid;
                Vector3d vec = Vector3d.ZAxis;

                Line line = new Line(p1, vec, height);

                doc.Objects.AddLine(line);
            }
        }

        catch(Exception ex)
        {
            ex.ToString();
        }
    }

where is the error?
how can i show line?


(Steve Baer) #2

Have you tried debugging the code? Place a breakpoint at the top of your function and step through to find the location where the error occurs.