2020 Property
Changes 0
P

Document.Phases

Description:
Retrieves all the object that represent phases within the project.
Remarks:
The phases returned are in order of earliest phase first, through to latest phase last.
public PhaseArray Phases { get; }
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);
}