Hi Caroline , I am using this code below , however I am getting an error , Do you know what I am doing wrong ? the floor is being created normally when there is no slabshapeditor Method, however when I use it I get this error. .

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using System.Reflection.Emit;
using Autodesk.Revit.DB.Visual;
namespace FloorTest
{
[Transaction(TransactionMode.Manual)]
public class FloorTest : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
// Get Document and UIDocument
UIDocument uidoc = commandData.Application.ActiveUIDocument;
Autodesk.Revit.DB.Document doc = commandData.Application.ActiveUIDocument.Document;
FilteredElementCollector collector = new FilteredElementCollector(doc);
collector.OfClass(typeof(FloorType));
FloorType floorType = collector.FirstElement() as FloorType;
// Build a floor profile for the floor creation
XYZ first = new XYZ(0, 0, 0);
XYZ second = new XYZ(20, 0, 0);
XYZ third = new XYZ(20, 15, 0);
XYZ fourth = new XYZ(0, 15, 0);
CurveLoop profile = new CurveLoop();
profile.Append(Line.CreateBound(first, second));
profile.Append(Line.CreateBound(second, third));
profile.Append(Line.CreateBound(third, fourth));
profile.Append(Line.CreateBound(fourth, first));
FilteredElementCollector levCollector = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Levels).WhereElementIsNotElementType();
Level lev = levCollector.FirstElement() as Level;
Transaction actrans = new Transaction(doc);
actrans.Start("create Sloped Floor");
Floor Floor= Floor.Create(doc, new List<CurveLoop> { profile }, floorType.Id, lev.Id);
//declare slabshapeeditor
SlabShapeEditor slabshapeedit = Floor.SlabShapeEditor;
//start a transaction
slabshapeedit.DrawPoint(new XYZ(0, 15, 15));
actrans.Commit();
return Result.Succeeded;
}
}
}