Level.Create
Method
Description:
Creates a new instance of level based on an input elevation.
Creates a new instance of level based on an input elevation.
Examples
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;
}
Parameters
Parameter | Type | Description |
---|---|---|
document | Document | The document in which the new instance is created |
elevation | Double | The elevation of the level to be created. |
Return Value
Type | Description |
---|---|
Level | The newly created level instance. |
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | A non-optional argument was null |