Autodesk.Revit.ApplicationServices.Application app = commandData.Application.Application;
Document activeDoc = commandData.Application.ActiveUIDocument.Document;
XYZ start = new XYZ(0, 0, 0);
XYZ end = new XYZ(10, 10, 0);
Transaction t=new Transaction (activeDoc, "transaction");
t.Start();
Line geomLine = Line.CreateBound(start, end);
Level level = Level.Create(activeDoc, 20.0);
Wall.Create(activeDoc, geomLine, level.Id , true);
t.Commit();
return Result.Succeeded;