Document Phases Property |
Retrieves all of the phases in the document.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)


The phases are returned in order from earliest phase to latest phase.
When Revit is running with UI activated, the default created phase for newly created elements is inherited from the phase of the currently active view.
When Revit is running without its UI, such as when Revit runs on Autodesk Forge Design Automation API for Revit, the default phase for newly created elements is the latest phase in the document.

void Getinfo_Phase(Document doc)
{
// Get the phase array which contains all the phases.
PhaseArray phases = doc.Phases;
// Format the prompt string which identifies all supported phases in the current document.
String prompt = null;
if (0 != phases.Size)
{
prompt = "All the phases in current document list as follow:";
foreach (Phase ii in phases)
{
prompt += "\n\t" + ii.Name;
}
}
else
{
prompt = "There are no phases in current document.";
}
// Give the user the information.
TaskDialog.Show("Revit",prompt);
}
