Namespace:
Autodesk.Revit.DB
Level
Class
Description:
Represents a Level within Autodesk Revit.
Represents a Level within Autodesk Revit.
Remarks:
A Level is conceptually a horizontal rectangle of finite extents. It appears as a straight line in views that intersect the rectangle. The straight line represents the projection of the rectangle onto the view. The Name property can be used to retrieve the user visible name of the level that appears in the level bubble.
A Level is conceptually a horizontal rectangle of finite extents. It appears as a straight line in views that intersect the rectangle. The straight line represents the projection of the rectangle onto the view. The Name property can be used to retrieve the user visible name of the level that appears in the level bubble.
Inheritance Hierarchy:
System.Object
Autodesk.Revit.DB.Element
Autodesk.Revit.DB.DatumPlane
Autodesk.Revit.DB.Level
System.Object
Autodesk.Revit.DB.Element
Autodesk.Revit.DB.DatumPlane
Autodesk.Revit.DB.Level
Examples
private void GetLevelInformation(Autodesk.Revit.DB.Element element)
{
// Get the level object to which the element is assigned.
if (element.LevelId.Equals(ElementId.InvalidElementId))
{
TaskDialog.Show("Revit","The element isn't based on a level.");
}
else
{
Level level = element.Document.GetElement(element.LevelId) as Level;
// Format the prompt information(Name and elevation)
String prompt = "The element is based on a level.";
prompt += "\nThe level name is: " + level.Name;
prompt += "\nThe level elevation is: " + level.Elevation;
// Show the information to the user.
TaskDialog.Show("Revit",prompt);
}
}