Phases Property


Retrieves all the object that represent phases within the project.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)

Syntax

C#
public PhaseArray Phases { get; }
Visual Basic
Public ReadOnly Property Phases As PhaseArray
	Get
Visual C++
public:
property PhaseArray^ Phases {
	PhaseArray^ get ();
}

Remarks

The phases returned are in order of earliest phase first, through to latest phase last.

Examples

Copy C#
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);
}
Copy VB.NET
Private Sub Getinfo_Phase(doc As Document)
    ' Get the phase array which contains all the phases.
    Dim phases As PhaseArray = doc.Phases
    ' Format the prompt string which identifies all supported phases in the current document.
    Dim prompt As [String] = Nothing
    If 0 <> phases.Size Then
        prompt = "All the phases in current document list as follow:"
        For Each ii As Phase In phases
            prompt += vbLf & vbTab + ii.Name
        Next
    Else
        prompt = "There are no phases in current document."
    End If
    ' Give the user the information.
    TaskDialog.Show("Revit", prompt)
End Sub

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →