For creating a circular slab using the Revit API, simply creating a circular arc with start angle 0 and end angle of Math.Pi * 2 (which means 360 degrees) and passing this arc to the NewFloor() does not work. It throws an error.
The approach is to use two semi-circular arcs to complete the entire circular profile and then using these two semi-circular arcs in the NewFloor() method. The following short (and sweet) code snippet illustrates this approach:
// get access to application and document object
Document doc = commandData.Application.ActiveUIDocument.Document;
Application app = commandData.Application.Application;
// Define the plane
Autodesk.Revit.DB.Plane pln = new Autodesk.Revit.DB.Plane(
XYZ.BasisZ, XYZ.Zero);
CurveArray ca = new CurveArray();
// Start the transaction
Transaction trans = new Transaction(doc, "slab");
trans.Start();
double radius = 40;
double startAngle = 0; // unit : radians
double endAngle = Math.PI;
// Create the first arc
Autodesk.Revit.DB.Arc a = app.Create.NewArc(
pln, radius, startAngle, endAngle);
ca.Append(a);
// Create the second arc
Autodesk.Revit.DB.Arc a1 = app.Create.NewArc(
pln, radius, -endAngle, startAngle);
ca.Append(a1);
doc.Create.NewFloor(ca, true);
trans.Commit();
And this creates a neat circular slab!