NewRoom Method (Level, UV)


Document New Room(Level, UV) Method

Creates a new room on a level at a specified point.

Namespace: Autodesk.Revit.Creation
Assembly: RevitAPI (in RevitAPI.dll) Version: 27.0.4.0 (27.0.4.0)
Syntax
public Room NewRoom(
	Level level,
	UV point
)

Parameters

level Level
The level on which the room is to exist.
point UV
A 2D point that dictates the location of the room on that specified level.

Return Value

Room
If successful the new room will be returned, otherwise .
Exceptions
Exception Condition
ArgumentException Thrown if the level does not exist in the given document.
Remarks
This method will regenerate the document even in manual regeneration mode.
Example
C#
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;
}
See Also
ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →