I didn't try the code, but maybe this works:
Grid g = Grid.Create(doc, Line.CreateBound(new XYZ(0.0, 0.0, 0.0), new XYZ(10.0, 0.0, 0.0))); Reference r1 = g.Curve.GetEndPointReference(0); Reference r2 = g.Curve.GetEndPointReference(1);
Let me know.
regards
Christian