RVTDocs.com
Namespace: Autodesk.Revit.DB Class: Level

Level.GetNearestLevelId(Document, Double)

Method
Description:
Returns id of the Level which is closest to the specified elevation.
Remarks:
The level can be at, above or below the target elevation. If there is more than one Level at the same distance from the elevation, the Level with the lowest Id will be returned.
Syntax
public static ElementId GetNearestLevelId(
	Document document,
	double elevation
)
Parameters
Parameter Type Description
document Document The document.
elevation Double Target Elevation.
Return Value
Exceptions
Exception Condition
ArgumentNullException A non-optional argument was null