2024 Property
Changes 0
P

Element.DemolishedPhaseId

Description:
Id of a Phase at which the Element was demolished.
Remarks:
After setting the property, DemolishedPhaseId regeneration can fail if CreatedPhaseId and DemolishedPhaseId are out of order with respect to their index in the property Document.Phases. Can be set to invalid element id.
public ElementId DemolishedPhaseId { get; set; }
void ShowPhaseDemolishedName(Element element)
{
    // Get the Phase Demolished property, and check whether it be null
    Autodesk.Revit.DB.Phase phaseDemolished = element.Document.GetElement(element.DemolishedPhaseId) as Phase;
    if (null == phaseDemolished)
    {
        TaskDialog.Show("Revit","This Element doesn't have Phase Demolished parameter.");
    }
    else
    {
        // Show the Phase Demolished name to the user.
        String prompt = "The phase demolished is: " + phaseDemolished.Name;
        TaskDialog.Show("Revit",prompt);
    }
}