/// <summary> /// The implementation of the automatic stairs creation command. /// </summary> public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { UIDocument activeDocument = commandData.Application.ActiveUIDocument; Document document = activeDocument.Document; // Create an automation utility with a hardcoded stairs configuration number StairsAutomationUtility utility = StairsAutomationUtility.Create(document, stairsConfigs[stairsIndex]); // Generate the stairs utility.GenerateStairs(); stairsIndex++; if (stairsIndex > 4) { stairsIndex = 0; } return(Result.Succeeded); }
/// <summary> /// The implementation of the automatic stairs creation. /// </summary> public void Execute(Document document) { //UIDocument activeDocument = commandData.Application.ActiveUIDocument; //Document document = activeDocument.Document; // Create an automation utility with a hardcoded // stairs configuration number StairsAutomationUtility utility = StairsAutomationUtility.Create( document, stairsConfigs[stairsIndex]); // Generate the stairs utility.GenerateStairs(); ++stairsIndex; if (stairsIndex > 4) { stairsIndex = 0; } }
/// <summary> /// Sets up a new stairs automation utility. /// </summary> /// <param name="document">The document in which the stairs will be created.</param> /// <param name="stairsNumber">The predefined stairs configuration number.</param> /// <returns></returns> public static StairsAutomationUtility Create(Autodesk.Revit.DB.Document document, int stairsNumber) { StairsAutomationUtility utility = new StairsAutomationUtility(document, stairsNumber); return(utility); }