NewLevel Method


Creates a new level.

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

Syntax

C#
[ObsoleteAttribute("This method is deprecated in Revit 2016. Use Level.Create() instead.")]
public Level NewLevel(
	double elevation
)
Visual Basic
<ObsoleteAttribute("This method is deprecated in Revit 2016. Use Level.Create() instead.")> _
Public Function NewLevel ( _
	elevation As Double _
) As Level
Visual C++
[ObsoleteAttribute(L"This method is deprecated in Revit 2016. Use Level.Create() instead.")]
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 = Level.Create(document, 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 = level.Create(document, 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

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →