Thank you very much for your help. Based on your code here's a simplified and more complete version:
//Pick point
Autodesk.Revit.DB.XYZ pickPoint;
ObjectSnapTypes snapTypes = ObjectSnapTypes.None;
pickPoint = uidoc.Selection.PickPoint(snapTypes, "Select a point inside the room to create");
UV roomLocation = new UV(pickPoint.X, pickPoint.Y);
//Level
Autodesk.Revit.DB.View activeView;
activeView = doc.ActiveView;
Level activeLevel = activeView.GenLevel;
//Create the room
ElementId roomID=null;
using (Transaction t = new Transaction(doc, "Create Room"))
{
try
{
t.Start();
Room newRoom;
newRoom = doc.Create.NewRoom(activeLevel, roomLocation);
roomID = newRoom.Id;
t.Commit();
}
catch ( Exception ex)
{
MessageBox.Show(ex.Message);
}
}
I also have a more complete version with failure options with the help of 2 posts by Jeremy Tammik:
https://thebuildingcoder.typepad.com/blog/2010/04/failure-api.html
https://thebuildingcoder.typepad.com/blog/2012/04/failure-rollback.html
Thank you again for your help.