RVTDocs.com
Namespace: Autodesk.Revit.Creation Class: Document

NewRoom

Method
Description:
Creates a new room on a level at a specified point.
Remarks:
This method will regenerate the document even in manual regeneration mode.
Syntax
public Room NewRoom(
	Level level,
	UV point
)
Examples
Room CreateRoom(Autodesk.Revit.DB.Document document, Level level)
{
    // Create a UV structure which determines the room location
   UV roomLocation = new UV(0, 0);

    // Create a new room
    Room room = document.Create.NewRoom(level, roomLocation);
    if (null == room)
    {
        throw new Exception("Create a new room failed.");
    }

    return room;
}
Parameters
Parameter Type Description
level Autodesk.Revit.DB.Level The level on which the room is to exist.
point Autodesk.Revit.DB.UV A 2D point that dictates the location of the room on that specified level.
Return Value
Type Description
Autodesk.Revit.Exceptions.ArgumentException If successful the new room will be returned, otherwise nullNothingnullptr a null reference (Nothingin Visual Basic) .
Exceptions
Exception Condition
Autodesk.Revit.Exceptions.ArgumentException Thrown if the level does not exist in the given document.