Creates a new instance of level based on an input elevation.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
Syntax
C# |
---|
public static Level Create(
Document document,
double elevation
) |
Visual Basic |
---|
Public Shared Function Create ( _
document As Document, _
elevation As Double _
) As Level |
Visual C++ |
---|
public:
static Level^ Create(
Document^ document,
double elevation
) |
Parameters
- document
- Type: Autodesk.Revit.DB..::..Document
The document in which the new instance is created
- elevation
- Type: System..::..Double
The elevation of the level to be created.
Return Value
The newly created level instance.
Examples
CopyC#
Level CreateLevel(Autodesk.Revit.DB.Document document)
{
double elevation = 20.0;
Level level = Level.Create(document, elevation);
if (null == level)
{
throw new Exception("Create a new level failed.");
}
level.Name = "New level";
return level;
}
CopyVB.NET
Private Function CreateLevel(document As Autodesk.Revit.DB.Document) As Level
Dim elevation As Double = 20.0
Dim level As Level = level.Create(document, elevation)
If level Is Nothing Then
Throw New Exception("Create a new level failed.")
End If
level.Name = "New level"
Return level
End Function
Exceptions
See Also