Creates a new level.
Namespace: Autodesk.Revit.Creation
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- elevation
- Type: System Double
The elevation to apply to the new level.
Return Value
The newly created level.Remarks
Default level attributes will apply to this new model.
Examples

Level CreateLevel(Autodesk.Revit.DB.Document document)
{
// The elevation to apply to the new level
double elevation = 20.0;
// Begin to create a level
Level level = document.Create.NewLevel(elevation);
if (null == level)
{
throw new Exception("Create a new level failed.");
}
// Change the level name
level.Name = "New level";
return level;
}

Private Function CreateLevel(document As Autodesk.Revit.DB.Document) As Level
' The elevation to apply to the new level
Dim elevation As Double = 20.0
' Begin to create a level
Dim level As Level = document.Create.NewLevel(elevation)
If level Is Nothing Then
Throw New Exception("Create a new level failed.")
End If
' Change the level name
level.Name = "New level"
Return level
End Function