NewLevel Method


Creates a new level.

Namespace: Autodesk.Revit.Creation
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)

Syntax

C#
public Level NewLevel(
	double elevation
)
Visual Basic
Public Function NewLevel ( _
	elevation As Double _
) As Level
Visual C++
public:
Level^ NewLevel(
	double elevation
)

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

Copy C#
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;
}
Copy VB.NET
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

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →