Retrieves all the object that represent phases within the project.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
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

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); }

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