M

Document.NewRoom

Description:
Creates a new room on a level at a specified point.
Remarks:
This method will regenerate the document even in manual regeneration mode.
Overloads (3):
NewRoom(Level,UV)
public Room NewRoom(
	Level level,
	UV point
)
Return Value nullNothingnullptr If successful the new room will be returned, otherwise null Nothing nullptr a null reference ( Nothing in Visual Basic) .
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;
}