public void CreatReferencePlane()
{
   Document doc = this.ActiveUIDocument.Document;    
   if(!doc.IsFamilyDocument)
      return;
            
   using(Transaction transaction = new Transaction(doc, "Editing Family"))
   {
      transaction.Start();
      XYZ bubbleEnd = new XYZ(0,5,5);
      XYZ freeEnd = new XYZ(5, 5, 5);
      XYZ cutVector = XYZ.BasisY;
      View view = doc.ActiveView;
      ReferencePlane referencePlane = doc.FamilyCreate.NewReferencePlane(bubbleEnd, freeEnd, cutVector, view);
      referencePlane.Name = "MyReferencePlane";
      transaction.Commit();                
   }
}