I would like to insert a reference plane using 3 3D points.
Here is my code and I don't know why it doesn't work. pleeeaaaase can you help me?
public void DrawSurface()
{
RefPlane myRefPlane = default(RefPlane);
ModelDoc2 swDoc = ((ModelDoc2)(iSwApp.ActiveDoc));
swDoc.SketchManager.InsertSketch(false);
swDoc.SketchManager.Insert3DSketch(true);
SketchPoint SkPoint1 = ((SketchPoint)(swDoc.SketchManager.CreatePoint(2,3,4)));
SketchPoint SkPoint2 = ((SketchPoint)(swDoc.SketchManager.CreatePoint(4,1,2)));
SketchPoint SkPoint3 = ((SketchPoint)(swDoc.SketchManager.CreatePoint(l1,1,1)));
swDoc.SketchManager.Insert3DSketch(false);
bool boolstatus;
boolstatus = swDoc.Extension.SelectByID2("Point1@Esquisse3D1", "EXTSKETCHPOINT", 2,3,4, true, 0, null, 0);
boolstatus = swDoc.Extension.SelectByID2("Point2@Esquisse3D1", "EXTSKETCHPOINT", 4,1,2, true, 1, null, 0);
boolstatus = swDoc.Extension.SelectByID2("Point3@Esquisse3D1", "EXTSKETCHPOINT", 1,1,1, true, 2, null, 0);
myRefPlane = ((RefPlane)(swDoc.FeatureManager.InsertRefPlane(4, 0, 4, 0, 4, 0)));
}
SolidworksApi macros