public Result Execute(
ExternalCommandData commandData,
ref string message,
ElementSet elements)
{
Document doc = commandData.Application
.ActiveUIDocument.Document;
FilteredElementCollector collector
= new FilteredElementCollector( doc );
collector.OfClass( typeof( Level ) );
Level level = collector.FirstElement() as Level;
Transaction t = new Transaction( doc );
t.Start( "Create unbounded room" );
FailureHandlingOptions failOpt
= t.GetFailureHandlingOptions();
failOpt.SetFailuresPreprocessor(
new RoomWarningSwallower() );
t.SetFailureHandlingOptions( failOpt );
doc.Create.NewRoom( level, new UV( 0, 0 ) );
t.Commit();
return Result.Succeeded;
}